Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    JavaScript alternative for HTML accesskey

    Hi There,

    I'm developing a simple web application (they are a "choose the right answer" type of exercise) using JavaScript to deal with the data and logic behind this application. These applications require pressing a button to answer some proposed questions. My question is:
    Is there a way, using JavaScript, to create some accesKeys without having to press ALT+key (IE) or CTRL+ALT+key (mozilla firefox)?

    Thanks in Advance!

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,133
    Thanks
    12
    Thanked 332 Times in 328 Posts
    you can monitor the keys pressed on a keyboard. if the character pressed (resp. its number) is the one you want, you can trigger the desired action.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • Users who have thanked Dormilich for this post:

    Zoldado12 (08-25-2010)

  • #3
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks, sometimes we just need the name of something to make google search more efficient. I had accesskey in my mind, but I think "monitoring pressed keys" will get it done.

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,133
    Thanks
    12
    Thanked 332 Times in 328 Posts
    related JavaScript Events: keypress, keydown, keyup. be aware that IE has different event methods than the DOM.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • Users who have thanked Dormilich for this post:

    Zoldado12 (08-26-2010)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •