The combination of JavaScript and HTML is called as DHTML (Dynamic HTML). Since not all browsers support the same level of DHTML, the events you can use and the way events work vary from browser to browser.
The following table contains the JavaScript events that are safe for browsers (Cross-Browser) that support JavaScript.
Cross-Browser JavaScript Events
| Event |
Description |
Applies To |
| onClick |
Occurs when the user clicks on a control |
button, area, checkbox, radio, link |
| onChange |
Occurs when the user changes value in an iput control. The
event fires after user changes focus to another control in text
controls |
select, text, textarea |
| onFocus |
Occurs when a control is focused |
select, text, textarea |
| onBlur |
Occurs when focus leaves a control |
select, text, textarea |
| onLoad |
Occurs when a page finishes downloading |
window, location |
| onUnload |
Occurs after a link has been clicked or a new URL has been
entered just before the download of the new page. |
window |
| onMouseOver |
Occurs when the user moves the mouse over a control |
link, area |
| onMouseOut |
Occurs when the user moves the mouse away from a control |
link, area |
| onKeyUp |
Occurs when the user releases a key |
text, textarea |
| onKeyDown |
Occurs when the user presses a key |
text, textarea |
| onSelect |
Occurs when the user selects a text on an input control |
text, textarea |
| onAbort |
Occurs when the user cancels an image download |
image |
| onError |
Occurs when an image cannot be downloaded |
image |
The JavaScript events listed above are tested on:
- Internet Explorer 5
- Internet Explorer 5.5
- Internet Explorer 6
- Internet Explorer 7
- Mozilla Firefox 2+
- Mozilla 1.75+
- Safari 1.3+
- Opera 8+
- Netscape 4+
For more details on Javascript event compatibility: Event compatibility tables
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5