JavaScript Events
Difficulty: Advanced
Category:
- Presentation
To ensure that JavaScript events can be triggered with both the mouse and the keyboard either a device independent event handler OR a mouse dependent event handler (such as onmouseover) and a keyboard dependent event handler (such as onkeypress) must be used. Keep in mind that some event handlers change their device dependence based on where they are used. For example, the onclick event handler is device independent (works with both the mouse and the keyboard), but only on elements that can receive keyboard focus (links and form elements that can be tabbed to).