DOCevents: a few notes on using events. There is a lot on this in "DOCjava". ---------- N.B. javascript is case sensitive, but HTML is not: so use caseSensitive version always. So in HTML: will both work. BUT the javascript attribute names as in 'element.onclick = myFunction;' seem to be Ucase. onkeypress N.B. cf. http://unixpapa.com/js/key.html onclick onload onunload, onbeforeunload, onpagehide onSubmit onMouseOver, onMouseOut [not onMouseEnter -- IE only; not onHover] A] Catch them all for the whole page. This shows how to catch all keyboard input, and separately all mouse clicks, to a page/window, and then act on them. Can sort out what keys to respond to in the handler. Note that you can use an object (BODY) to catch events it can't get directly e.g. keypresses, which normally only go to in-focus boxes. E.g. FORMS can catch them, even though a FORM isn't a DOM object. B] onunload. I use this in doTiny.php and apparently it is to do with fixing the browser's behaviour on back-button. And that an explicitly empty handler may suppress a hidden default handler. ==== More notes: perhaps should be moved. If an object has both an event handler (e.g. onclick) and a default action, then the handler is exec. first. The handler returns true -> now do the default The handler returns false -> now suppress the default