HTML <ol> tagS2C Home   « HTML <ol> tag

Definition

The <ol> tag and it's closing </ol> tag defines an ordered list.

Example


<ol>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
</ol>

Required Attributes

NONE

Optional Attributes

compact - this attribute is deprecated, use CSS instead.

start - this attribute is deprecated, use CSS instead.

type - this attribute is deprecated, use CSS instead.

Common Attributes

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


<ol class="classname"></ol>

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


<ol id="idname"></ol>

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


<ol style="color:red;text-align:left"></ol>

title - specifies extra information about the content.


<ol title="information about the content"></ol>

Language Attributes

dir - specifies the directional flow of the content.


<ol dir="ltr"></ol>   <!-- The text will flow from left to right -->
<ol dir="rtl"></ol>   <!-- The text will flow from right to left -->

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


<ol lang="en"></ol>

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


<ol xml:lang="fr"></ol>

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.


<ol onkeydown="go()"></ol>   <!-- Executes the go() function -->

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


<ol onkeypress="go()"></ol>   <!-- Executes the go() function -->

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


<ol onkeyup="go()"></ol>   <!-- Executes the go() function -->

Mouse Event Attributes

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


<ol onclick="go()"></ol>   <!-- Executes the go() function --> 

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


<ol ondblclick="go()"></ol>   <!-- Executes the go() function -->

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


<ol onmousedown="go()"></ol>   <!-- Executes the go() function -->

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


<ol onmousemove="go()"></ol>   <!-- Executes the go() function -->

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


<ol onmouseout="go()"></ol>   <!-- Executes the go() function -->

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


<ol onmouseover="go()"></ol>   <!-- Executes the go() function -->

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


<ol onmouseup="go()"></ol>   <!-- Executes the go() function -->

go to home page Homepage go to top of page Top