Global HTML Attributes

The attributes listed below are standard, and are supported by most HTML and XHTML tags. There were some exceptions as late as HTML 4.01 and XHTML 1.1, but HTML5 says they are all supported but not necessarily useful. An attribute is an extension to an element, and is used to include more choices towards the overall functionality. Many can be combined together but most of them only work in specific elements.

Language Attributes
Useless in,  ,  ,  ,  ,  ,  , and   elements.

Data Attributes
These attributes store data to the page and/or application.

Inline event handlers
Refer to Global Event Attributes for inline event handlers

Every type of event has a corresponding attribute which can set the event-handler of an element for that event type. The attribute's name is "on" followed by the name of the event - for example, "onclick" for click events. However, per Separation of Layers these attributes should not be used except in special cases. See the article on Events for the encouraged solution. Here is a list of event attributes: