HTML <dfn> tagS2C Home   « HTML <dfn> tag

Definition

The <dfn> tag is used to represent the defining instance of a term.

The paragraph, description list group, or section that is the nearest ancestor of the <dfn> element must also contain the definition(s) for the term given by the <dfn> element.

Example


<p>Jeff Lynne was a founding member of 70s band 
  <dfn><abbr  title="Electric Light Orchestra">ELO</abbr></dfn>
   who had a lot of success in the charts.</p>
<p>They had many top 10 hits in the UK and <abbr  title="Electric Light Orchestra">ELO</abbr> 
and were known for their symbiosis of rock and classical music.</p>

Jeff Lynne was a founding member of 70s band ELO who had a lot of success in the charts.

They had many top 10 hits in the UK and ELO were known for their symbiosis of rock and classical music.

Attributes

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


<dfn> Specific Attributes
Attribute Value Description Example
There are no required or optional attributes specific to the <dfn> tag.
<dfn> 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.

<dfn class="name">Definition Term Text</dfn>
idSpecifies a unique id for the element allowing you to apply the style of the predefined id to the content.

<dfn id="name">Definition Term Text</dfn>
styleSpecifies an inline style for the element allowing you to apply the style to the contentt.

<dfn style="color:red;">Definition Term Text</dfn>
titleSpecifies an inline style for the element allowing you to apply the style to the content.

<dfn title="Content info">Definition Term Text</dfn>
Keyboard
accesskeySpecifies a keyboard shortcut to associate with the element.

<dfn accesskey="a">Definition Term Text</dfn>
tabindexSpecifies a tab order for the element.

<dfn tabindex="1">Definition Term Text</dfn>
Language
dirSpecifies the directional flow of the content.

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

<dfn lang="en">Definition Term Text</dfn>
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. -->
<dfn spellcheck="true">Definition Term Text</dfn> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

<!-- Valid values yes and no. -->
<!-- Default yes. -->
<dfn translate="no">Definition Term Text</dfn> 
Miscellaneous
contenteditableSpecifies whether the content of the element is editable.

<!-- Valid values true and false. -->
<!-- Default inherited. -->
<dfn contenteditable="true">Definition Term Text</dfn> 
draggableSpecifies whether the element is draggable.

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

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

 <!-- Executes go() function -->
<dfn oncopy="go()">Definition Term Text</dfn> 
oncutThe script to be run when the user cuts the content of an element.

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

 <!-- Executes go() function -->
<dfn onpaste="go()">Definition Term Text</dfn>
Drag and Drop
ondragThe script to be run when an element is dragged.

 <!-- Executes go() function -->
<dfn ondrag="go()">Definition Term Text</dfn>
ondragendThe script to be run when an element has stopped being dragged.

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

 <!-- Executes go() function -->
<dfn ondragenter="go()">Definition Term Text</dfn>
ondragleaveThe script to be run when an element leaves a valid drop target.

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

 <!-- Executes go() function -->
<dfn ondragover="go()">Definition Term Text</dfn>
ondragstartThe script to be run at the start of a drag operation.

 <!-- Executes go() function -->
<dfn ondragstart="go()">Definition Term Text</dfn>
ondropThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<dfn ondrop="go()">Definition Term Text</dfn>
Form
onblurThe script to be run when the element loses focus.

 <!-- Executes go() function -->
<dfn onblur="go()">Definition Term Text</dfn>
onchangeThe script to be run when object changed and attempt to leave field.

 <!-- Executes go() function -->
<dfn onchange="go()">Definition Term Text</dfn>
oncontextmenuThe script to be run when a context menu is triggered.

 <!-- Executes go() function -->
<dfn oncontextmenu="go()">Definition Term Text</dfn>
onfocusThe script to be run when the element gets focus.

 <!-- Executes go() function -->
<dfn onfocus="go()">Definition Term Text</dfn>
oninputThe script to be run when an element gets user input.

 <!-- Executes go() function -->
<dfn oninput="go()">Definition Term Text</dfn>
oninvalidThe script to be run when an element is invalid.

 <!-- Executes go() function -->
<dfn oninvalid="go()">Definition Term Text</dfn>
onresetThe script to be run when a dragged element is being dropped.

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

 <!-- Executes go() function -->
<dfn onselect="go()">Definition Term Text</dfn>
onsubmitThe script to be run when a form is submitted.

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

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

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

 <!-- Executes go() function -->
<dfn onkeyup="go()">Definition Term Text</dfn>
Media
onabortThe script code to be run on abort.

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

 <!-- Executes go() function -->
<dfn oncanplay="go()">Definition Term Text</dfn>
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 -->
<dfn oncanplaythrough="go()">Definition Term Text</dfn>
oncuechangeThe script to be run when the cue changes when using the track element.

 <!-- Executes go() function -->
<dfn oncuechange="go()">Definition Term Text</dfn>
ondurationchangeThe script to be run when the length of the media is changed.

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

 <!-- Executes go() function -->
<dfn onemptied="go()">Definition Term Text</dfn>
onendedThe script to be run when the media has reach the end.

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

 <!-- Executes go() function -->
<dfn onloadeddata="go()">Definition Term Text</dfn>
onloadedmetadataThe script to be run when metadata has been loaded.

 <!-- Executes go() function -->
<dfn onloadedmetadata="go()">Definition Term Text</dfn>
onloadstartThe script to be run whenthe media resource has started loading.

 <!-- Executes go() function -->
<dfn onloadstart="go()">Definition Term Text</dfn>
onpauseThe script to be run when the media resource has been paused.

 <!-- Executes go() function -->
<dfn onpause="go()">Definition Term Text</dfn>
onplayThe script to be run when the media resource starts playback.

 <!-- Executes go() function -->
<dfn onplay="go()">Definition Term Text</dfn>
onplayingThe script to be run when when playback has already begun.

 <!-- Executes go() function -->
<dfn onplaying="go()">Definition Term Text</dfn>
onprogressThe script to be run when the browser is fetching the media data.

 <!-- Executes go() function -->
<dfn onprogress="go()">Definition Term Text</dfn>
onratechangeThe script to be run when the playback rate changes.

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

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

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

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

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

 <!-- Executes go() function -->
<dfn ontimeupdate="go()">Definition Term Text</dfn>
onvolumechangeThe script to be run when the volume has changed or been muted.

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

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

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

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

 <!-- Executes go() function -->
<dfn onmousedown="go()">Definition Term Text</dfn>
onmousemoveThe script to be run when the mouse button is moved.

 <!-- Executes go() function -->
<dfn onmousemove="go()">Definition Term Text</dfn>
onmouseoutThe script to be run when the mouse cursor moves off an element.

 <!-- Executes go() function -->
<dfn onmouseout="go()">Definition Term Text</dfn>
onmouseoverThe script to be run when the mouse cursor moves over an element.

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

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

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

 <!-- Executes go() function -->
<dfn onscroll="go()">Definition Term Text</dfn> 
Window - NONE

Relevant HTML Tutorial

HTML Intermediate - More Formatting