Long story short, I'm enhancing an existing registration form to perform a simple "are you human" check. Easy stuff (one would think). I haven't even gotten to the good stuff yet, because I can't seem to set the innerHTML of a couple span
elements on the page.
Here's the stripped down code...
<form method="post" action="register2.php">Please verify that you are human below...
<br/> <span id="num1"></span> X
<input id="num2" style="width:20px" /> equals <span id="answer"></span>
<br>
<input id="submit" type="submit" value="Register" disabled="disabled" />
</form>
And the stripped down script...
$('#submit').attr("disabled", "disabled");
var num1 = Math.floor((Math.random() * 11));
var num2 = Math.floor((Math.random() * 11));
var answer = num1 * num2;
$('#num1').innerHTML = "" + num1;
$('#answer').innterHTML = "" + answer;
At this point... I would just like to see the last two lines set the correct form elements so that I can continue to work on the validation functions. I must have a typo or logic error in here... thoughts?
Here's the fiddle: http://jsfiddle.net/2e9Xc/