125
rated 0 times
[
129]
[
4]
/ answers: 1 / hits: 46037
/ 15 Years ago, wed, march 3, 2010, 12:00:00
If you replace onkeydown with click, it reacts, at least.
<input id=yourinput type=text />
<script type=text/javascript>
document.getElementById(yourinput).addEventListener(onkeydown, keyDownTextField, false);
function keyDownTextField() {
alert(functional);
if(keycode==13) {
alert(You hit the enter key.);
}
else{
alert(Oh no you didn't.);
}
}
</script>
More From » javascript