I have a single text field and a button. The button calls a function called validate(). It currently only works if you click the button, and I'm trying to change it to take keyboard input using 'enter' on keyboard. I have written the following from tutorials, but it doesn't work - any pointers?
<input type="text" name="textField" onkeypress="handle(event)" onfocus="clearT()" />
function handle(e){
if(e.keyCode === 13){
validate();
}