Events Attribute Collection


 
Reference: *W3C - XHTML Modularisation 1.1 - Attribute Collections

Attributes in this Collection

All attributes in this Collection are declared by Intrinsic Events Module and are of type Script

onclick
Script to be executed when the element is clicked (mousedown and mouseup over the same element)
ondblclick
Script to be executed when the element is double-clicked
onmousedown
Script to be executed when a mouse button is pressed over the element
onmouseup
Script to be executed when a mouse button is released over the element
onmouseover
Script to be executed when the mouse pointer is moved over the element
onmousemove
Script to be executed when the mouse pointer is moved within the element
onmouseout
Script to be executed when the mouse pointer is moved out of the element
onkeypress
Script to be executed when the element has focus and a key is pressed down
onkeydown
Script to be executed when the element has focus and a key is pressed
onkeyup
Script to be executed when the element has focus and a currently pressed key is released

Where to Use Attributes in this Collection

All attributes in this Collection may be used on most elements in the Element Index - all except: base, bdo, br, head, html, meta, param, script, style, title.


Description

The attributes in the Events Attribute Collection are used to specify scripting code which is to be executed when the appropriate event occurs.

If you use any of the attributes in this Collection (of indeed any Type Script), the MIME type of the scripting language used should always be provided in a Content-Script-Type HTTP header.

It is good practice not to use these attributes, however, and instead to include external scripts (via script elements) which add any handlers unobtrusively. This makes code more self-contained and also the XHTML is easier to maintain if it doesn't contain any events attributes.


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 16 May 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Common Attributes (XHTML 1.1) > Events Attribute Collection