The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Is there a javascript event handler for the enter key?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #238477

    I tried using onkeydown and onkeypress but the space key seems to trigger it, so do other keys on the keyboard. Is there an event handler that will only trigger then the user persses the return/enter key?


    You have to use an if statement to test if the enter key is pressed (jquery method):

    The key code for the enter key is 13, here is a pen that will help you find the code for any key on your keyboard (not my work):

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.