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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -