HTML attribute

HTML attributes are special words used inside the opening tag to control the element's behaviour.

For example, the attribute name is used by several element types, but has slightly different functions in each.

The abbreviation element, abbr, can be used to demonstrate these various attributes: This example displays as HTML in blue without being a link, and in most browsers, pointing the cursor at the abbreviation should display the title text "Hypertext Markup Language" within a floating yellow background (tooltip).

They are all prefixed on-:[17] Event attributes, added in HTML version 4, allow an element to specify scripts to be run under specific circumstances.

The table below lists some common event handler attributes, and some elements they can function with.