SyntaxFix
Write A Post
Hire A Developer
Questions
Firstly, what 'doesn't work'? Do you not see the alert?
Also, Your code could be simplified to this
<input type="text" id="num1" name="num1" onkeydown="checkInput(this);" /> <br /> function checkInput(obj) { alert(obj.value); }