forms - Call key press with javascript -


i trying press tab , enter key through javascript/jquery on page load.

like:

  if(event.keycode == 13){     $("#submit").click();   }  

this work when user presses enter key want javascript stuff user on page load.

you can simulate keypress code:

function simulatekeypress(character) {   jquery.event.trigger({ type : 'keypress', : character.charcodeat(0) }); } 

thanks thread: is possible simulate key press events programmatically?

but ghyath serhal pointed out, there might better way simulate keypress catch same code.


Comments

Popular posts from this blog

jQuery Ajax Render Fragments OR Whole Page -

javascript - Iterate over array and calculate average values of array-parts -

ASP.NET Javascript: window.open won't work twice -