How can I execute some code when the Enter key is hit on a text field?
My approach doesn't do anything:
<script>
textfield.onkeydown = function(e) {
if (e.keyCode == 13) {
alert("abc");
}
}
</script>
<input type="text" id="textfield">
PS: I don't want to use JQuery.