HTML 4 - Common Attributes
This section covers the three categories of common attributes--those which show up in almost every tag. It gets extremely repetitive to list these same attributes over and over again, so they have been abbreviated into three categories: %il8n, %coreattrs, and %events. The abbreviations are those used by the WWC in their HTML specification.
|
lang=
|
|
|
Specifies language.
|
This attribute defines the language of the element.
|
|
dir=
|
|
|
Specifies left-to-right direction.
|
|
Specifies right-to-left direction.
|
This attribute tells the browser the direction of characters with weak (punctuation) and neutral (spacing) directionality. When used in the TABLE tag, it tells the browser which side of the table to place the first column.
|
|
id=
|
|
|
Specifies the id name, which must be unique in the document. No other name, id, or class may have the same value.
|
This attribute gives the element its own ID (and so must be unique to the particular instance) for identification purposes. Scripts and style sheets may refer to an element by ID and links may use the ID like an anchor name.
|
|
class=
|
|
|
Specifies the classes to which the element belongs with a space-separated list of class names.
|
This attribute classifies the element by defining a list of classes to which it belongs. Class names can be used by style sheets to add formatting to all elements in the class.
|
|
title=
|
|
|
Gives the title.
|
This attribute gives a title to its element, just as the <TITLE> element gives a title for the document.
|
|
onclick=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a mouse clicks on the element.
You must specify a default scripting language!
|
|
ondblclick=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a mouse double-clicks on the element.
You must specify a default scripting language!
|
|
onmousedown=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a mouse button is pressed while the cursor is over the element.
You must specify a default scripting language!
|
|
onmouseup=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a mouse button that was pressed over the element was released.
You must specify a default scripting language!
|
|
onmouseover=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a cursor is over the element.
You must specify a default scripting language!
|
|
onmousemove=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a cursor moves over the element.
You must specify a default scripting language!
|
|
onmouseout=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script when a cursor that was over the element moves off the element.
You must specify a default scripting language!
|
|
onkeypress=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script if a key was pressed and released while the element was selected.
You must specify a default scripting language!
|
|
onkeydown=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script if a key was pressed down while the element was selected.
You must specify a default scripting language!
|
|
onkeyup=
|
|
|
Gives the script commands in the document's default scripting language.
|
This attribute tells the browser to execute the specified script if a key that was pressed is released while the element is selected.
You must specify a default scripting language!
|