javascript - Submit when enter is pressed on number input -


i want make when press enter when clicked on number input box

<input id="answer" type="number" style="display: none;" placeholder="answer box"/> 

it runs function

nextquestion() 

i want when press enter runs function

use can use .keypress() , .click() function in jquery bind multiple events same function

$('#answer').keypress(function(e){     if(e.which == 13)         //enter key code 13, capture when enter key pressed         nextquestion(); });  $('#answer').click(function(e){     nextquestion(); }); 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -