I do not understand what I'm doing wrong here. I just want my function to be called when I click the checkbox. Replacing a function call with alert() works, am I referring to my function incorrectly?
<html> <head></head> <body> <script type="text/javascript"> function select(a){ document.getElementById("myDiv").innerHTML=""+a; } </script> <input type="checkbox" onclick="select(1)"> <div id="myDiv">hi</div> </body> </html>
thanks
source share