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 - Feed FileReader from server side files -

java - How to create your own button and Use it with Scene Builder for javafx -

c++ - Drawing a circle in directx 9 -