This is the compatibility table for inline events, that is, events that are handled inside a tag.
Examples:
<A HREF="#" onMouseOver="omo()"> <TEXTAREA onKeyUp="checkItAll()"> <P onDblClick="anotherFunction()">
Notes:
Event | HTML Element | NN2 | IE3 | Op3 | NN3 | Op4 | Op5 | NN4 | IE4 | IE5 | NN6 | iCab | WebTV |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Abort | On <IMG> | No | Yes | No | Yes | No | |||||||
Blur Focus | On form fields | Partial (Blur: Only for NN2 Mac) |
Yes (Mac: Partial) |
Partial | Yes (V4 Mac & NN4 Linux: Partial) |
Partial | Yes | ||||||
On <BODY> | No | Yes (Mac: No) |
No | Yes (Mac: No except for iCab) |
Impossible | ||||||||
Note for Netscape 6: The good old onBlur="self.focus()" in a popup crashes my Netscape 6.01 horribly, while the reverse onFocus="self.blur()" does nothing. | |||||||||||||
Click | On <A> | Yes | |||||||||||
On form fields | Partial | Yes | Partial | ||||||||||
On <P> | No | Yes | No | Yes | No | ||||||||
Change | On form fields | Partial | Yes | ||||||||||
Dblclick | On <A> | No | Yes (NN4 Linux: No) |
No | |||||||||
On <P> | No | Yes | No | ||||||||||
Error (note) |
On <IMG> | No | Yes | No | Yes | ||||||||
On <BODY> | No (NN4 Linux: Yes) |
Yes | No | ||||||||||
KeyDown KeyPress KeyUp | On text fields and textareas | No | Not KeyUp | Yes (IE4 Mac: Only KeyPress iCab: KeyUp fires onKeyDown!) | |||||||||
Note for Netscape 4: If you do document.captureEvents(Event.KEYPRESS | etc) the inline events won't work! | |||||||||||||
Load | On <BODY> | Yes | |||||||||||
Event | HTML Element | NN2 | IE3 | Op3 | NN3 | Op4 | Op5 | NN4 | IE4 | IE5 | NN6 | iCab | WebTV |
MouseDown MouseUp | On <A> | No | Yes | No | |||||||||
On <P> | No | Yes | No | Yes | Not MouseUp | No | |||||||
MouseMove | On <A> or <P> | No | Yes | No | Yes (IE4 Mac: No) |
No | |||||||
MouseOut MouseOver | On <A> | MouseOver, not MouseOut | Yes | ||||||||||
On <P> | No | Yes | No | Yes | No | ||||||||
Reset | On <FORM> | No | Yes | No | Yes | ||||||||
Resize | On <BODY> | No | Yes (V4 Mac: No) |
No | Impossible | ||||||||
Select | On text field and textarea | No | Yes | No | |||||||||
Submit | On <FORM> | Yes | |||||||||||
Unload | On <BODY> | No (Mac: Yes) | Yes | No | Yes | No | |||||||
Event | HTML Element | NN2 | IE3 | Op3 | NN3 | Op4 | Op5 | NN4 | IE4 | IE5 | NN6 | iCab | WebTV |
if you notice a mistake in this table, please tell me.
Few people will know that the onError event handler also exists for an <IMG>. When you do
<IMG SRC="whatever.gif" onError="doSomething()">
the script doSomething() is executed if whatever.gif (the SRC) is not found on the server. This can sometimes be very useful.
Even more to my surprise, Netscape 4 on Linux and Netscape 6 allow an onError event handler on the BODY tag, firing whenever a JavaScript error occurs.