javascript - Can anyone help me to use the enter key to execute this program? -
i have created small program pulls youtube api allows search random video whatever title enter when prompted. have working except, able hit enter key on keyboard run search. assume fix simple onkeydown event, have tried implement few ways , seems break every time. i'm not sure if because way calling onclicklistener or what. appreciated.
$('#searchterm').keydown(function(e){ if(e.keycode == 13){ search(); } });
Comments
Post a Comment