HTML5 Reference

HTML <dt> tag

Definition

The <dt> tag is used to define a definition term within a defintion list.

The <dt> tag must be followed by either another <dt> tag or one or more <dd> tags and these must be enclosed within a <dl> tag.

Example


<dl>
  <dt>Boys Names</dt>
    <dd>Pugh</dd>
    <dd>Hugh</dd>
  <dt>Girls Names</dt>
    <dd>Charlotte</dd>
    <dd>Emily</dd>
    <dd>Jane</dd>
</dl>
Boys Names
Pugh
Hugh
Girls Names
Charlotte
Emily
Jane

Attributes

The following attributes can be used with the <dl> tag.


<dl> Specific Attributes
Attribute Value Description Example
There are no required or optional attributes specific to the <dl> tag.
<dl> Global Attributes
Attribute Description Example
Common
classSpecifies a classname for the element allowing you to apply the style of the predefined class to the content.

<dt class="name">Defintion term</dt>
idSpecifies a unique id for the element allowing you to apply the style of the predefined id to the content.

<dt id="name">Defintion term</dt>
styleSpecifies an inline style for the element allowing you to apply the style to the contentt.

<dt style="color:red;">Defintion term</dt>
titleSpecifies an inline style for the element allowing you to apply the style to the content.

<dt title="Content info">Defintion term</dt>
Keyboard
accesskeySpecifies a keyboard shortcut to associate with the element.

<dt accesskey="a">Defintion term</dt>
tabindexSpecifies a tab order for the element.

<dt tabindex="1">Defintion term</dt>
Language
dirSpecifies the directional flow of the content.

<!-- The text will flow from left to right -->
<dt dir="ltr">Defintion term</dt>
<!-- The text will flow from right to left -->
<dt dir="rtl">Defintion term</dt>
langSpecifies a language code for the content of the element.

<dt lang="en">Defintion term</dt>
spellcheckSpecifies an inline style for the element allowing you to apply the style to the contentt.

<!-- Valid values true and false. -->
<!-- Default inherited/browser specific. -->
<dt spellcheck="true">Defintion term</dt> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

<!-- Valid values yes and no. -->
<!-- Default yes. -->
<dt translate="no">Defintion term</dt> 
Miscellaneous
contenteditableSpecifies whether the content of the element is editable.

<!-- Valid values true and false. -->
<!-- Default inherited. -->
<dt contenteditable="true">Defintion term</dt> 
draggableSpecifies whether the element is draggable.

<!-- Valid values true and false. -->
<!-- Default browser specific. -->
<dt draggable="true">Defintion term</dt>
hiddenSpecifies whether the element is not yet, or no longer, relevant.

<!-- Valid values an empty string or hidden -->
<dt hidden>Defintion term</dt> 
<dt hidden="hidden">Defintion term</dt> 
<dl> Event Attributes
Attribute Description Example
Document Element
oncopyThe script to be run when the user copies the content of an element.

 <!-- Executes go() function -->
<dt oncopy="go()">Defintion term</dt> 
oncutThe script to be run when the user cuts the content of an element.

 <!-- Executes go() function -->
<dt oncut="go()">Defintion term</dt>
onpasteThe script to be run when the user pastes some content into an element.

 <!-- Executes go() function -->
<dt onpaste="go()">Defintion term</dt>
Drag and Drop
ondragThe script to be run when an element is dragged.

 <!-- Executes go() function -->
<dt ondrag="go()">Defintion term</dt>
ondragendThe script to be run when an element has stopped being dragged.

 <!-- Executes go() function -->
<dt ondragend="go()">Defintion term</dt>
ondragenterThe script to be run when an element has been dragged to a valid drop target.

 <!-- Executes go() function -->
<dt ondragenter="go()">Defintion term</dt>
ondragleaveThe script to be run when an element leaves a valid drop target.

 <!-- Executes go() function -->
<dt ondragleave="go()">Defintion term</dt>
ondragoverThe script to be run when an element is being dragged over a valid drop target.

 <!-- Executes go() function -->
<dt ondragover="go()">Defintion term</dt>
ondragstartThe script to be run at the start of a drag operation.

 <!-- Executes go() function -->
<dt ondragstart="go()">Defintion term</dt>
ondropThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<dt ondrop="go()">Defintion term</dt>
Form
onblurThe script to be run when the element loses focus.

 <!-- Executes go() function -->
<dt onblur="go()">Defintion term</dt>
onchangeThe script to be run when object changed and attempt to leave field.

 <!-- Executes go() function -->
<dt onchange="go()">Defintion term</dt>
oncontextmenuThe script to be run when a context menu is triggered.

 <!-- Executes go() function -->
<dt oncontextmenu="go()">Defintion term</dt>
onfocusThe script to be run when the element gets focus.

 <!-- Executes go() function -->
<dt onfocus="go()">Defintion term</dt>
oninputThe script to be run when an element gets user input.

 <!-- Executes go() function -->
<dt oninput="go()">Defintion term</dt>
oninvalidThe script to be run when an element is invalid.

 <!-- Executes go() function -->
<dt oninvalid="go()">Defintion term</dt>
onresetThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<dt onreset="go()">Defintion term</dt>
onselectThe script to be run when some or all of the contents of an object are selected.

 <!-- Executes go() function -->
<dt onselect="go()">Defintion term</dt>
onsubmitThe script to be run when a form is submitted.

 <!-- Executes go() function -->
<dt onsubmit="go()">Defintion term</dt>
Keyboard
onkeydownThe script to be run when an element is in focus and keyboard key is pressed down.

 <!-- Executes go() function -->
<dt onkeydown="go()">Defintion term</dt>
onkeypressThe script to be run when an element is in focus and keyboard key is pressed down and released.

 <!-- Executes go() function -->
<dt onkeypress="go()">Defintion term</dt>
onkeyupThe script to be run when an element is in focus and keyboard key is released.

 <!-- Executes go() function -->
<dt onkeyup="go()">Defintion term</dt>
Media
onabortThe script code to be run on abort.

 <!-- Executes go() function -->
<dt onabort="go()">Defintion term</dt>
oncanplayThe script to be run when a file has buffered enough so it is ready to start playing.

 <!-- Executes go() function -->
<dt oncanplay="go()">Defintion term</dt>
oncanplaythroughThe script to be run when a file can be played all the way to the end without further need of buffering.

 <!-- Executes go() function -->
<dt oncanplaythrough="go()">Defintion term</dt>
oncuechangeThe script to be run when the cue changes when using the track element.

 <!-- Executes go() function -->
<dt oncuechange="go()">Defintion term</dt>
ondurationchangeThe script to be run when the length of the media is changed.

 <!-- Executes go() function -->
<dt ondurationchange="go()">Defintion term</dt>
onemptiedThe script to be run when a media resource element suddenly becomes empty, usually due to an error.

 <!-- Executes go() function -->
<dt onemptied="go()">Defintion term</dt>
onendedThe script to be run when the media has reach the end.

 <!-- Executes go() function -->
<dt onended="go()">Defintion term</dt>
onloadeddataThe script to be run when media data is loaded and playback can start.

 <!-- Executes go() function -->
<dt onloadeddata="go()">Defintion term</dt>
onloadedmetadataThe script to be run when metadata has been loaded.

 <!-- Executes go() function -->
<dt onloadedmetadata="go()">Defintion term</dt>
onloadstartThe script to be run whenthe media resource has started loading.

 <!-- Executes go() function -->
<dt onloadstart="go()">Defintion term</dt>
onpauseThe script to be run when the media resource has been paused.

 <!-- Executes go() function -->
<dt onpause="go()">Defintion term</dt>
onplayThe script to be run when the media resource starts playback.

 <!-- Executes go() function -->
<dt onplay="go()">Defintion term</dt>
onplayingThe script to be run when when playback has already begun.

 <!-- Executes go() function -->
<dt onplaying="go()">Defintion term</dt>
onprogressThe script to be run when the browser is fetching the media data.

 <!-- Executes go() function -->
<dt onprogress="go()">Defintion term</dt>
onratechangeThe script to be run when the playback rate changes.

 <!-- Executes go() function -->
<dt onratechange="go()">Defintion term</dt>
onseekedThe script to be run when the seeking attribute is set to false indicating that seeking has finished.

 <!-- Executes go() function -->
<dt onseeked="go()">Defintion term</dt>
onseekingThe script to be run when the seeking attribute is set to true indicating that seeking is currently active.

 <!-- Executes go() function -->
<dt onseeking="go()">Defintion term</dt>
onstalledThe script to be run when the browser is unable to continue fetching media data.

 <!-- Executes go() function -->
<dt onstalled="go()">Defintion term</dt>
onsuspendThe script to be run when media data has stopped before being completely loaded.

 <!-- Executes go() function -->
<dt onsuspend="go()">Defintion term</dt>
ontimeupdateThe script to be run when the media resources current playback position has changed.

 <!-- Executes go() function -->
<dt ontimeupdate="go()">Defintion term</dt>
onvolumechangeThe script to be run when the volume has changed or been muted.

 <!-- Executes go() function -->
<dt onvolumechange="go()">Defintion term</dt>
onwaitingThe script to be run when the media resource has paused but is expected to resume.

 <!-- Executes go() function -->
<dt onwaiting="go()">Defintion term</dt>
Mouse
onclickThe script to be run when when a mouse is clicked on an element.

 <!-- Executes go() function -->
<dt onclick="go()">Defintion term</dt>
ondblclickThe script to be run when a mouse is double clicked on an element.

 <!-- Executes go() function -->
<dt ondblclick="go()">Defintion term</dt>
onmousedownThe script to be run when he mouse button is pressed down while the cursor is over an element.

 <!-- Executes go() function -->
<dt onmousedown="go()">Defintion term</dt>
onmousemoveThe script to be run when the mouse button is moved.

 <!-- Executes go() function -->
<dt onmousemove="go()">Defintion term</dt>
onmouseoutThe script to be run when the mouse cursor moves off an element.

 <!-- Executes go() function -->
<dt onmouseout="go()">Defintion term</dt>>
onmouseoverThe script to be run when the mouse cursor moves over an element.

 <!-- Executes go() function -->
<dt onmouseover="go()">Defintion term</dt>
onmouseupThe script to be run when the mouse button is released while the cursor is over the element.

 <!-- Executes go() function -->
<dt onmouseup="go()">Defintion term</dt>
onwheelThe script to be run when the mouse wheel rolls up or down over an element.

 <!-- Executes go() function -->
<dt onwheel="go()">Defintion term</dt>
Scroll
onscrollThe script code to be run when the scrollbar of an element is being scrolled.

 <!-- Executes go() function -->
<dt onscroll="go()">Defintion term</dt> 
Window - NONE

Relevant HTML Tutorials

HTML Lessons - Lists