jquery - Javascript function not being called, function may be dead? -
i'm trying call js function when button clicked in html, won't run. button being clicked, because tested prompt , showed up, when put function there wont run...
function nextlesson(){ prompt("myprompt"); document.getelementbyid("kek23").innerhtml = <c:outvalue= "${lesson.getnextlesson()}"/>";} then call method in button
<p style="font-size: 4em" id ="kek23"></p> <button onclick = "nextlesson();" value = "next"/> we've found when function gives error, javascript declares entire function dead, don't know error
this works: had couple syntax issues killing function- including not wrapping innerhtml content in quotes - , button element not using correct syntax.
<p style="font-size: 4em" id ="kek23"></p> <button onclick = "nextlesson();" value = "next">next</button> <script> function nextlesson(){ prompt("myprompt"); document.getelementbyid("kek23").innerhtml = "<c:out value= ${lesson.getnextlesson()}/>" }; </script>
Comments
Post a Comment