Common Attributes and Events

A number of attributes are shared by nearly all elements. To save space, they have been abbreviated in this reference as they are in the Recommendations. This section serves as a reference for Alphabetical List of Elements and explains each attribute’s shorthand.

In HTML 4.01/XHTML 1.0, the attributes and events are divided into groups called Core, Internationalization, Focus, and Events. In HTML5, there is one set of Global Attributes that applies to all HTML elements.

HTML 4.01 and XHTML 1.0

Core

When Core is listed under Attributes, it refers to the set of core attributes that may be applied to the majority of elements (as noted in each element listing):

id

Assigns a unique identifying name to the element

class

Assigns one or more classification names to the element

style

Associates style information with an element

title

Provides a title or advisory information about the element

Internationalization

When Internationalization appears in the attribute list, it means the element accepts the set of attributes used to specify language and reading direction:

dir

Specifies the direction of the element (left to right or right to left).

lang

Specifies the language for the element by its language code.

xml:lang

XHTML only. Specifies language for elements in XHTML documents.

Focus

Focus refers to the state of being highlighted and ready for user input, such as for a link or form element. When Focus is listed, it indicates that the following attributes and events related to bringing ...

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.