HTML <abbr> tagS2C Home   « HTML <abbr> tag

Definition

The <abbr> tag is used to define an abbreviation and is generally used with the title attribute which specifies the phrase or word being abbreviated.

Example


<abbr title="Electric Light Orchestra">ELO</abbr>

Required Attributes

NONE

Optional Attributes

NONE

Common Attributes

class - specifies a classname for the element allowing you to apply the style of the predefined class to the content.


<abbr class="classname">Some text here</abbr>

id - specifies a unique id for the element allowing you to apply the style of the predefined id to the content.


<abbr id="idname">Some text here</abbr>

style - specifies an inline style for the element allowing you to apply the style to the content.


<abbr style="color:red;text-align:left">Some text here</abbr>

title - specifies extra information about the content.


<abbr title="information about the content">Some text here</abbr>

Language Attributes

dir - specifies the directional flow of the content.


<!-- The text will flow from left to right -->
<abbr dir="ltr">Some text here</abbr>

<!-- The text will flow from right to left -->
<abbr dir="rtl">Some text here</abbr>

lang - specifies a language code for the content of the element.


<abbr lang="en">Some text here</abbr>

xml:lang - specifies a language code for the content of the element in XHTML documents.


<abbr xml:lang="fr">Some text here</abbr>

Document Event Attributes

NONE

Form Event Attributes

NONE

Image Event Attributes

NONE

Keyboard Event Attributes

onkeydown - The JavaScript code to be run when an element is in focus and keyboard key is pressed.


<!-- Executes the go() function -->
<abbr onkeydown="go()">Some text here</abbr>

onkeypress - The JavaScript code to be run when an element is in focus and keyboard key is pressed down and released.


<!-- Executes the go() function -->
<abbr onkeypress="go()">Some text here</abbr>

onkeyup - The JavaScript code to be run when an element is in focus and keyboard key is released.


<!-- Executes the go() function -->
<abbr onkeyup="go()">Some text here</abbr>

Mouse Event Attributes

onclick - The JavaScript code to be run when a mouse is clicked on the element.


<!-- Executes the go() function -->
<abbr onclick="go()">Some text here</abbr>

ondblclick - The JavaScript code to be run when a mouse is double clicked on the element.


<!-- Executes the go() function -->
<abbr ondblclick="go()">Some text here</abbr>

onmousedown - The JavaScript code to be run when the mouse button is pressed down while the cursor is over the element.


<!-- Executes the go() function -->
<abbr onmousedown="go()">Some text here</abbr>

onmousemove - The JavaScript code to be run when the mouse button is moved.


<!-- Executes the go() function -->
<abbr onmousemove="go()">Some text here</abbr>

onmouseout - The JavaScript code to be run when the mouse cursor moves off an element.


<!-- Executes the go() function -->
<abbr onmouseout="go()">Some text here</abbr>

onmouseover - The JavaScript code to be run when the mouse cursor moves over an element.


<!-- Executes the go() function -->
<abbr onmouseover="go()">Some text here</abbr>

onmouseup - The JavaScript code to be run when the mouse button is released while the cursor is over the element.


<!-- Executes the go() function -->
<abbr onmouseup="go()">Some text here</abbr>

go to home page Homepage go to top of page Top