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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -