View Full Version : JavaScript alternative for HTML accesskey

08-23-2010, 10:43 PM
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!

08-24-2010, 03:41 PM
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.

08-25-2010, 02:47 AM
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.

08-25-2010, 10:32 AM
related JavaScript Events: keypress, keydown, keyup. be aware that IE has different event methods than the DOM.