HTML <u> tagS2C Home   « HTML <u> tag

Definition

The <u> tag is used for representing a span of text with an Unarticulated, non-textual annotation, such as proper names in Chinese text or misspelt words.

The <u> tag should not be used for underlining from HTML5 onwards as was the case in earlier versions of HTML, even though it will generally be rendered underlined in browsers

Use css attributes such as the CSS text-decoration property for underlining text.

Example


<p>People with cockney accents don't always pronounce their words <u>proper</u>.</p>

People with cockney accents don't always pronounce their words proper.

Attributes

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


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

<u class="name">Unarticulated, non-textual annotation</u>
idSpecifies a unique id for the element allowing you to apply the style of the predefined id to the content.

<u id="name">Unarticulated, non-textual annotation</u>
styleSpecifies an inline style for the element allowing you to apply the style to the contentt.

<u style="color:red;">Unarticulated, non-textual annotation</u>
titleSpecifies an inline style for the element allowing you to apply the style to the content.

<u title="Content info">Unarticulated, non-textual annotation</u>
Keyboard
accesskeySpecifies a keyboard shortcut to associate with the element.

<u accesskey="a">Unarticulated, non-textual annotation</u>
tabindexSpecifies a tab order for the element.

<u tabindex="1">Unarticulated, non-textual annotation</u>
Language
dirSpecifies the directional flow of the content.

<!-- The text will flow from left to right -->
<u dir="ltr">Unarticulated, non-textual annotation</u>
<!-- The text will flow from right to left -->
<u dir="rtl">Unarticulated, non-textual annotation</u>
langSpecifies a language code for the content of the element.

<u lang="en">Unarticulated, non-textual annotation</u>
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. -->
<u spellcheck="true">Unarticulated, non-textual annotation</u> 
translateSpecifies an inline style for the element allowing you to apply the style to the content.

<!-- Valid values yes and no. -->
<!-- Default yes. -->
<u translate="no">Unarticulated, non-textual annotation</u> 
Miscellaneous
contenteditableSpecifies whether the content of the element is editable.

<!-- Valid values true and false. -->
<!-- Default inherited. -->
<u contenteditable="true">Unarticulated, non-textual annotation</u> 
draggableSpecifies whether the element is draggable.

<!-- Valid values true and false. -->
<!-- Default browser specific. -->
<u draggable="true">Unarticulated, non-textual annotation</u>
hiddenSpecifies whether the element is not yet, or no longer, relevant.

<!-- Valid values an empty string or hidden -->
<u hidden>Unarticulated, non-textual annotation</u> 
<u hidden="hidden">Unarticulated, non-textual annotation</u> 
<u> Event Attributes
Attribute Description Example
Document Element
oncopyThe script to be run when the user copies the content of an element.

 <!-- Executes go() function -->
<u oncopy="go()">Unarticulated, non-textual annotation</u> 
oncutThe script to be run when the user cuts the content of an element.

 <!-- Executes go() function -->
<u oncut="go()">Unarticulated, non-textual annotation</u>
onpasteThe script to be run when the user pastes some content into an element.

 <!-- Executes go() function -->
<u onpaste="go()">Unarticulated, non-textual annotation</u>
Drag and Drop
ondragThe script to be run when an element is dragged.

 <!-- Executes go() function -->
<u ondrag="go()">Unarticulated, non-textual annotation</u>
ondragendThe script to be run when an element has stopped being dragged.

 <!-- Executes go() function -->
<u ondragend="go()">Unarticulated, non-textual annotation</u>
ondragenterThe script to be run when an element has been dragged to a valid drop target.

 <!-- Executes go() function -->
<u ondragenter="go()">Unarticulated, non-textual annotation</u>
ondragleaveThe script to be run when an element leaves a valid drop target.

 <!-- Executes go() function -->
<u ondragleave="go()">Unarticulated, non-textual annotation</u>
ondragoverThe script to be run when an element is being dragged over a valid drop target.

 <!-- Executes go() function -->
<u ondragover="go()">Unarticulated, non-textual annotation</u>
ondragstartThe script to be run at the start of a drag operation.

 <!-- Executes go() function -->
<u ondragstart="go()">Unarticulated, non-textual annotation</u>
ondropThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<u ondrop="go()">Unarticulated, non-textual annotation</u>
Form
onblurThe script to be run when the element loses focus.

 <!-- Executes go() function -->
<u onblur="go()">Unarticulated, non-textual annotation</u>
onchangeThe script to be run when object changed and attempt to leave field.

 <!-- Executes go() function -->
<u onchange="go()">Unarticulated, non-textual annotation</u>
oncontextmenuThe script to be run when a context menu is triggered.

 <!-- Executes go() function -->
<u oncontextmenu="go()">Unarticulated, non-textual annotation</u>
onfocusThe script to be run when the element gets focus.

 <!-- Executes go() function -->
<u onfocus="go()">Unarticulated, non-textual annotation</u>
oninputThe script to be run when an element gets user input.

 <!-- Executes go() function -->
<u oninput="go()">Unarticulated, non-textual annotation</u>
oninvalidThe script to be run when an element is invalid.

 <!-- Executes go() function -->
<u oninvalid="go()">Unarticulated, non-textual annotation</u>
onresetThe script to be run when a dragged element is being dropped.

 <!-- Executes go() function -->
<u onreset="go()">Unarticulated, non-textual annotation</u>
onselectThe script to be run when some or all of the contents of an object are selected.

 <!-- Executes go() function -->
<u onselect="go()">Unarticulated, non-textual annotation</u>
onsubmitThe script to be run when a form is submitted.

 <!-- Executes go() function -->
<u onsubmit="go()">Unarticulated, non-textual annotation</u>
Keyboard
onkeydownThe script to be run when an element is in focus and keyboard key is pressed down.

 <!-- Executes go() function -->
<u onkeydown="go()">Unarticulated, non-textual annotation</u>
onkeypressThe script to be run when an element is in focus and keyboard key is pressed down and released.

 <!-- Executes go() function -->
<u onkeypress="go()">Unarticulated, non-textual annotation</u>
onkeyupThe script to be run when an element is in focus and keyboard key is released.

 <!-- Executes go() function -->
<u onkeyup="go()">Unarticulated, non-textual annotation</u>
Media
onabortThe script code to be run on abort.

 <!-- Executes go() function -->
<u onabort="go()">Unarticulated, non-textual annotation</u>
oncanplayThe script to be run when a file has buffered enough so it is ready to start playing.

 <!-- Executes go() function -->
<u oncanplay="go()">Unarticulated, non-textual annotation</u>
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 -->
<u oncanplaythrough="go()">Unarticulated, non-textual annotation</u>
oncuechangeThe script to be run when the cue changes when using the track element.

 <!-- Executes go() function -->
<u oncuechange="go()">Unarticulated, non-textual annotation</u>
ondurationchangeThe script to be run when the length of the media is changed.

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

 <!-- Executes go() function -->
<u onemptied="go()">Unarticulated, non-textual annotation</u>
onendedThe script to be run when the media has reach the end.

 <!-- Executes go() function -->
<u onended="go()">Unarticulated, non-textual annotation</u>
onloadeddataThe script to be run when media data is loaded and playback can start.

 <!-- Executes go() function -->
<u onloadeddata="go()">Unarticulated, non-textual annotation</u>
onloadedmetadataThe script to be run when metadata has been loaded.

 <!-- Executes go() function -->
<u onloadedmetadata="go()">Unarticulated, non-textual annotation</u>
onloadstartThe script to be run whenthe media resource has started loading.

 <!-- Executes go() function -->
<u onloadstart="go()">Unarticulated, non-textual annotation</u>
onpauseThe script to be run when the media resource has been paused.

 <!-- Executes go() function -->
<u onpause="go()">Unarticulated, non-textual annotation</u>
onplayThe script to be run when the media resource starts playback.

 <!-- Executes go() function -->
<u onplay="go()">Unarticulated, non-textual annotation</u>
onplayingThe script to be run when when playback has already begun.

 <!-- Executes go() function -->
<u onplaying="go()">Unarticulated, non-textual annotation</u>
onprogressThe script to be run when the browser is fetching the media data.

 <!-- Executes go() function -->
<u onprogress="go()">Unarticulated, non-textual annotation</u>
onratechangeThe script to be run when the playback rate changes.

 <!-- Executes go() function -->
<u onratechange="go()">Unarticulated, non-textual annotation</u>
onseekedThe script to be run when the seeking attribute is set to false indicating that seeking has finished.

 <!-- Executes go() function -->
<u onseeked="go()">Unarticulated, non-textual annotation</u>
onseekingThe script to be run when the seeking attribute is set to true indicating that seeking is currently active.

 <!-- Executes go() function -->
<u onseeking="go()">Unarticulated, non-textual annotation</u>
onstalledThe script to be run when the browser is unable to continue fetching media data.

 <!-- Executes go() function -->
<u onstalled="go()">Unarticulated, non-textual annotation</u>
onsuspendThe script to be run when media data has stopped before being completely loaded.

 <!-- Executes go() function -->
<u onsuspend="go()">Unarticulated, non-textual annotation</u>
ontimeupdateThe script to be run when the media resources current playback position has changed.

 <!-- Executes go() function -->
<u ontimeupdate="go()">Unarticulated, non-textual annotation</u>
onvolumechangeThe script to be run when the volume has changed or been muted.

 <!-- Executes go() function -->
<u onvolumechange="go()">Unarticulated, non-textual annotation</u>
onwaitingThe script to be run when the media resource has paused but is expected to resume.

 <!-- Executes go() function -->
<u onwaiting="go()">Unarticulated, non-textual annotation</u>
Mouse
onclickThe script to be run when when a mouse is clicked on an element.

 <!-- Executes go() function -->
<u onclick="go()">Unarticulated, non-textual annotation</u>
ondblclickThe script to be run when a mouse is double clicked on an element.

 <!-- Executes go() function -->
<u ondblclick="go()">Unarticulated, non-textual annotation</u>
onmousedownThe script to be run when he mouse button is pressed down while the cursor is over an element.

 <!-- Executes go() function -->
<u onmousedown="go()">Unarticulated, non-textual annotation</u>
onmousemoveThe script to be run when the mouse button is moved.

 <!-- Executes go() function -->
<u onmousemove="go()">Unarticulated, non-textual annotation</u>
onmouseoutThe script to be run when the mouse cursor moves off an element.

 <!-- Executes go() function -->
<u onmouseout="go()">Unarticulated, non-textual annotation</u>
onmouseoverThe script to be run when the mouse cursor moves over an element.

 <!-- Executes go() function -->
<u onmouseover="go()">Unarticulated, non-textual annotation</u>
onmouseupThe script to be run when the mouse button is released while the cursor is over the element.

 <!-- Executes go() function -->
<u onmouseup="go()">Unarticulated, non-textual annotation</u>
onwheelThe script to be run when the mouse wheel rolls up or down over an element.

 <!-- Executes go() function -->
<u onwheel="go()">Unarticulated, non-textual annotation</u>
Scroll
onscrollThe script code to be run when the scrollbar of an element is being scrolled.

 <!-- Executes go() function -->
<u onscroll="go()">Unarticulated, non-textual annotation</u> 
Window - NONE

Relevant HTML Tutorials

HTML Basics - Inline Semantics