Red indicates a deprecated attribute.
| HTML Attributes | |||
|---|---|---|---|
| Attribute | Membership | Description | Examples |
accept |
<input> |
Specifies the types of files that the server accepts via upload | |
accept-charset |
<form> |
Specifies the character encodings that are to be used for the form submission | |
accesskey |
global |
Specifies a key that can be used, with ALT, to put the focus on the element | |
action |
<form> |
Specifies the program to process the submitted form | |
align |
<div> |
Specifies the alignment of content within the element | |
alt |
<area>, <img>, <input> |
Specifies alternative text that is shown when the element fails | |
async |
<script> |
Specifies the asynchronous execution of the script, for external scripts | |
autocomplete |
<form>, <input> |
Specifies whether autocomplete should be used or not | |
autofocus |
<button>, <input>, <select>, <textarea> |
Specifies that an element should get the focus when the page is loaded | |
autoplay |
<audio>, <video> |
Specifies that an audio or video file should automatically play when the page loads | |
bgcolor |
visible |
Specifies the background color of an element | |
border |
visible |
Specifies the border width of an element | |
charset |
<meta>, <script> |
Specifies the character set | |
checked |
<input> |
Specifies that the element should be checked when the page is loaded | |
cite |
<blockquote>, <del>, <ins>, <q> |
A URL that specifies the source for a quotation or explains why text was deleted or inserted | |
class |
global |
Specifies one or more classes to which the element belongs | |
color |
visible |
Specifies the color of the text of an element | |
cols |
<textarea> |
Specifies the number of columns of text in a textarea | |
colspan |
<td>, <th> |
Specifies the number of columns that the cell spans | |
content |
<meta> |
Defines the content associated with a name or http-equiv attribute | |
contenteditable |
global |
Specifies whether or not the text in a element is editable | |
controls |
<audio>, <video> |
Specifies that controls should be included | |
coords |
<area> |
Specifies a set of values used to define the geometry of an area element | |
data |
<object> |
Specifies the URL of a resource to be used for the object | |
data-* |
global |
Specifies custom data that can be read and used by a program | |
datetime |
<del>, <ins>, <time> |
Specifies the date and time in a standardized format | |
default |
<track> |
Specifies the track is to be used, if no other preference is indicated | |
defer |
<script> |
This specifies that the script will run when the page finishes loading. It is only usable for external scripts. | |
dir |
global |
This specifies direction of the text direction in the element: ltr, rtl, or auto. | |
dirname |
<input>, <textarea> |
This specifies direction of the text according to the text element: ltr or rtl. The value is always the name of the input field with .dir appended to it. | |
disabled |
<button>, <fieldset>, <input>, <optgroup>, <option>, <select>, <textarea> |
This specifies that an element or set of elements should be disabled. | |
download |
<a>, <area> |
This specifies that target should be downloaded when the link is clicked. | |
draggable |
global |
The boolean value of this specifies whether the element is draggable or not. | |
enctype |
<form> |
This specifies how the data is to be encoded when it is submitted. The default value is application/x-www-form-urlencoded. | |
for |
<label>, <output> |
This specifies the element or elements to which this one is bound. | |
form |
<button>, <fieldset>, <input>, <label>, <meter>, <object>, <output>, <select>, <textarea> |
This specifies the id of the form to which this element belongs. | |
formaction |
<button>, <input> |
This specifies where the form data should be sent when it is submitted. | |
headers |
<td>, <th> |
This specifies the ids of headers cells that are related to the cell. | |
height |
<canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> |
This specifies the height of the element. | |
hidden |
global |
This specifies that the element should not be displayed. | |
high |
<meter> |
This specifies the value, above which, values are considered high. | |
href |
<a>, <area>, <base>, <link> |
This specifies the URL to which the element links. | |
hreflang |
<a>, <area>, <link> |
This specifies the language of the content to which the element links. | |
http-equiv |
<meta> |
This specifies the header for the value of the content attribute. | |
id |
global |
This specifies a unique id for the element. | |
ismap |
<img> |
This is included to specify the image as a server-side image map. | |
kind |
<track> |
This specifies the kind of text in the track: captions, chapters, descriptions, metadata, or subtitles. | |
label |
<track>, <option>, <optgroup> |
This specifies the title of text in the track. | |
lang |
global |
This specifies the language of the content in the element. | |
list |
<input> |
This specifies a datalist element that contains pre-defined options for the input element. | |
loop |
<audio>, <video> |
This specifies that the element will replay when it is finished. | |
low |
<meter> |
This specifies the value, below which, values are considered low. | |
max |
<input>, <meter>, <progress> |
This specifies the maximum value for the element. | |
maxlength |
<input>, <textarea> |
This specifies the maximum number of charaters allowed in the element. | |
media |
<a>, <area>, <link>, <source>, <style> |
This specifies the media or device for which the document is optimized. | |
method |
<form> |
This specifies HTTP method to be used when sending the data for the form. | |
min |
<input>, <meter> |
This specifies the minimum value for the element. | |
multiple |
<input>, <select> |
This specifies that the element allows multiple values to be entered. | |
muted |
<audio>, <video> |
This specifies that the element is to be muted. | |
name |
<button>, <fieldset>, <form>, <iframe>, <input>, <map>, <meta>, <object>, <output>, <param>, <select>, <textarea> |
This specifies the name of the element. | |
novalidate |
<form> |
This specifies that the form should not be validated when it is submitted. | |
onabort |
<audio>, <embed>, <img>, <object>, <video> |
This specifies the script to be run on abort. | |
onafterprint |
<body> |
This specifies the script to be run after the document is printed. | |
onbeforeprint |
<body> |
This specifies the script to be run before the document is printed. | |
onbeforeunload |
<body> |
This specifies the script to be run before the document is unloaded. | |
onblur |
selectable |
This specifies the script to be run when the element loses focus. Almost any element can be made selectable via the contenteditable attribute. | |
oncanplay |
<audio>, <embed>, <object>, <video> |
This specifies the script to be run when a file has buffered enough to start playing. | |
oncanplaythrough |
<audio>, <video> |
This specifies the script to be run when a file can play through the end without buffering. | |
onchange |
selectable |
This specifies the script to be run when the element is changed. Almost any element can be made selectable via the contenteditable attribute. | |
onclick |
visible |
This specifies the script to be run when the element is clicked. | |
oncontextmenu |
visible |
This specifies the script to be run when the user right-clicks to open a context menu. | |
oncopy |
selectable |
This specifies the script to be run when the user copies the content of the element. Almost any element can be made selectable via the contenteditable attribute. | |
oncuechange |
<track> |
This specifies the script to be run when the cue changes. | |
oncut |
selectable |
This specifies the script to be run when the user cuts the content from the element. Almost any element can be made selectable via the contenteditable attribute. | |
ondblclick |
visible |
This specifies the script to be run when the element is double-clicked. | |
ondrag |
visible |
This specifies the script to be run when the user drags the element. Almost any element can be made draggable via the draggable attribute. | |
ondragend |
visible |
This specifies the script to be run when the user ends the drag. Almost any element can be made draggable via the draggable attribute. | |
ondragenter |
visible |
This specifies the script to be run when the user drags into a valid drop target. Almost any element can be made draggable via the draggable attribute. | |
ondragleave |
visible |
This specifies the script to be run when the user drags out of a valid drop target. Almost any element can be made draggable via the draggable attribute. | |
ondragover |
visible |
This specifies the script to be run when the user drags over a valid drop target. Almost any element can be made draggable via the draggable attribute. | |
ondragstart |
visible |
This specifies the script to be run when the user begins to drag the element. Almost any element can be made draggable via the draggable attribute. | |
ondrop |
visible |
This specifies the script to be run when the dragged element is dropped. Almost any element can be made draggable via the draggable attribute. | |
ondurationchange |
<audio>, <video> |
This specifies the script to be run when length of the media changes. | |
onemptied |
<audio>, <video> |
This specifies the script to be run when the file in not available. | |
onended |
<audio>, <video> |
This specifies the script to be run when the player reaches the end of the file. | |
onerror |
<audio>, <body>, <embed>, <img>, <object>, <script>, <style>, <video> |
This specifies the script to be run when an error occurs. | |
onfocus |
selectable |
This specifies the script to be run when the element receives focus. Almost any element can be made selectable via the contenteditable attribute. | |
onhashchange |
<body> |
This specifies the script to be run when there has been a change to the anchor part of the current URL. | |
oninput |
selectable |
This specifies the script to be run when the element receives input. Almost any element can be made selectable via the contenteditable attribute. | |
oninvalid |
selectable |
This specifies the script to be run when the element becomes invalid. Almost any element can be made selectable via the contenteditable attribute. | |
onkeydown |
selectable |
This specifies the script to be run when key is pressed and the element has focus. Almost any element can be made selectable via the contenteditable attribute. | |
onkeypress |
selectable |
This specifies the script to be run when key is pressed and released and the element has focus. Almost any element can be made selectable via the contenteditable attribute. | |
onkeyup |
selectable |
This specifies the script to be run when key is released and the element has focus. Almost any element can be made selectable via the contenteditable attribute. | |
onload |
<body>, <iframe>, <img>, <input>, <link>, <script>, <style> |
This specifies the script to be run when the element is finished loading. | |
onloadeddata |
<audio>, <video> |
This specifies the script to be run when the media file is loaded. | |
onloadedmetadata |
<audio>, <video> |
This specifies the script to be run when the meta data is loaded. | |
onloadstart |
<audio>, <video> |
This specifies the script to be run when the file begins to load. | |
onmousedown |
visible |
This specifies the script to be run when the mouse button is pressed on the element. | |
onmousemove |
visible |
This specifies the script to be run as the mouse cursor moves over the element. | |
onmouseout |
visible |
This specifies the script to be run when the mouse cursor leaves the element. | |
onmouseover |
visible |
This specifies the script to be run when the mouse cursor enters the element. | |
onmouseup |
visible |
This specifies the script to be run when the mouse button is release on the element. | |
onmousewheel |
visible |
This specifies the script to be run when the mouse wheel is scrolled on the element. | |
onoffline |
<body> |
This specifies the script to be run when the starts to work offline. | |
ononline |
<body> |
This specifies the script to be run when the starts to work online. | |
onpagehide |
<body> |
This specifies the script to be run when navigates to a different URL. | |
onpageshow |
<body> |
This specifies the script to be run when navigates to the page. | |
onpaste |
selectable |
This specifies the script to be run when the user pastes content to the element. Almost any element can be made selectable via the contenteditable attribute. | |
onpause |
<audio>, <video> |
This specifies the script to be run when the playback is paused. | |
onplay |
<audio>, <video> |
This specifies the script to be run when the media starts playing. | |
onplaying |
<audio>, <video> |
This specifies the script to be run when the media starts playing. | |
onpopstate |
<body> |
This specifies the script to be run when the window history changes. | |
onprogress |
<audio>, <video> |
This specifies the script to be run when the browser is getting media data. | |
onratechange |
<audio>, <video> |
This specifies the script to be run when the playback rate changes. | |
onreset |
<form> |
This specifies the script to be run when a reset button in the form is clicked. | |
onresize |
<body> |
This specifies the script to be run when the window is resized. | |
onscroll |
visible |
This specifies the script to be run when the user alters the scrollbar for the element. | |
onsearch |
<input> |
This specifies the script to be run when a search term is entered into a search field: <input type="search">. | |
onseeked |
<audio>, <video> |
This specifies the script to be run when the seeking attribute is set to false to indicate that the seeking ended. | |
onseeking |
<audio>, <video> |
This specifies the script to be run when the seeking attribute is set to true to indicate that the seeking active. | |
onselect |
visible |
This specifies the script to be run when the element is selected. | |
onstalled |
<audio>, <video> |
This specifies the script to be run when the media data can not be retrieved. | |
onstorage |
<body> |
This specifies the script to be run when the web storage is updated. | |
onsubmit |
<form> |
This specifies the script to be run when a submit button in the form is clicked. | |
onsuspend |
<audio>, <video> |
This specifies the script to be run when the media loading is stopped before completion. | |
ontimeupdate |
<audio>, <video> |
This specifies the script to be run when the play position has changed. | |
ontoggle |
<details> |
This specifies the script to be run when the detail element is opened or closed. | |
onunload |
<body> |
This specifies the script to be run when the page is unloaded. | |
onvolumechange |
<audio>, <video> |
This specifies the script to be run when the volume is changed. | |
onwaiting |
<audio>, <video> |
This specifies the script to be run when the media is waiting to resume, like when it is buffering. | |
onwheel |
visible |
This specifies the script to be run when the mouse wheel rolls over and element. | |
open |
<details> |
This specifies that the details are open by default. | |
optimum |
<meter> |
This specifies the optimal value for the meter that defines the optimal range. | |
pattern |
<input> |
This specifies the regular exression that the value is checked against. | |
placeholder |
<input>, <textarea> |
This specifies a hint to indicate the expected input. | |
poster |
<video> |
This specifies an image to be shown before the video plays. | |
preload |
<audio>, <video> |
This specifies how the file should load when the page loads: auto, metadata, or none. | |
readonly |
<input>, <textarea> |
This specifies that the element is read only. | |
rel |
<a>, <area>, <form>, <link> |
This specifies relationship between the current document and the linked one. | |
required |
<input>, <select>, <textarea> |
This specifies that the element must be filled out before the form that it belongs to can be submitted. | |
reversed |
<ol> |
This specifies that the list items should be numbered in reverse order. | |
rows |
<textarea> |
This specifies the number of rows of text in the textarea element. | |
rowspan |
<td>, <th> |
This specifies the number of rows of the table that the element should span. | |
sandbox |
<iframe> |
This specifies that there should be certain restrictions on the iframe. | |
scope |
<th> |
This specifies whether the header is for a row or column or a group of either of them. | |
selected |
<option> |
This specifies that the option should be selected by default. | |
shape |
<area> |
This specifies the shape of the area. | |
size |
<input>, <select> |
This specifies the number of characters in the input or the number of visible options in a select. | |
span |
<col>, <colgroup> |
This specifies the number of columns to span. | |
spellcheck |
global |
This specifies, with a boolean value, whether the element should have its spelling and grammar checked. | |
src |
<audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video> |
This specifies location of the source file. | |
srcdoc |
<iframe> |
This specifies HTML content of the page to show in the iframe. | |
srclang |
<track> |
This specifies language of the track text data. | |
start |
<ol> |
This specifies start value for the for the ordered list. | |
step |
<input> |
This specifies allowed value multiples for the field. | |
style |
global |
This specifies styles that are to be applied to the element. | |
tabindex |
global |
This specifies the order that the element selected when tab is pressed. | |
target |
<a>, <area>, <base>, <form> |
This specifies where the linked document should be opened: _blank, _parent, _self, or _top. | |
title |
global |
This specifies the title that is displayed for the element. | |
translate |
global |
This specifies whether the content in the element should be translated. | |
type |
<a>, <button>, <embed>, <input>, <link>, <menu>, <object>, <script>, <source>, <style> |
This specifies the type of the element. | |
usemap |
<img>, <object> |
This specifies name of the map to be used for the image map. | |
value |
<button>, <input>, <li>, <option>, <meter>, <progress>, <param> |
This specifies the value for the element. | |
width |
<canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> |
This specifies the width of the element. | |
wrap |
<textarea> |
This specifies how the text in the textarea element is to be wrapped: soft or hard. | |
© 20072025 XoaX.net LLC. All rights reserved.