Attribute |
Belongs to |
Description |
accept |
<input> |
This defines the kinds of files the server can receive (only when using type="file"). |
accept-charset |
<form> |
This defines the specific way characters are coded for sending a form. |
accesskey |
Global Attributes |
A shortcut key is a quick way to make an element active or bring it into focus. |
action |
<form> |
Tells the browser where to send the form information when the form is submitted. |
align |
Not supported in HTML 5. |
Describing the arrangement based on nearby items. Utilize CSS for this instead of copying. |
alt |
<area>, , <input> |
When the original thing cannot be shown, an alternate text is given instead. |
async |
<script> |
Indicates that the script is run in the background without waiting, but this applies only to external scripts. |
autocomplete |
<form>, <input> |
Decides if the autocomplete feature should be turned on for either the <form> or the <input> element. |
autofocus |
<button>, <input>, <select>, <textarea> |
Indicates that the element should receive focus as soon as the page finishes loading. |
autoplay |
<audio>, <video> |
Indicates that the audio or video will begin playing as soon as it's prepared. |
bgcolor |
Not supported in HTML 5. |
This sets the element's background color. Instead, employ CSS for this purpose. |
border |
Not supported in HTML 5. |
Describes how thick the outline of an element is. Instead, employ CSS for this purpose. |
charset |
<meta>, <script> |
Character encoding specifies how characters are represented |
checked |
<input> |
Indicates that a checkbox or radio button should be already chosen when the webpage opens. |
cite |
<blockquote>, <del>, <ins>, <q> |
Provides a web link that clarifies the quoted, removed, or added content. |
class |
Global Attributes |
Indicates class names for an element (points to a class in a style sheet). |
color |
Not supported in HTML 5. |
This defines the color of text in a part of a webpage. Instead, employ CSS for this purpose. |
cols |
<textarea> |
Describes how wide a text area looks. |
colspan |
<td>, <th> |
Indicates how many columns a table cell should cover. |
content |
<meta> |
Provides the worth linked to the http-equiv or name feature. |
contenteditable |
Global Attributes |
Indicates if the stuff inside an element can be changed or not. |
controls |
<audio>, <video> |
Indicates that buttons for audio/video control (like play/pause) must be shown. |
coords |
<area> |
Provides the exact location's points. |
data |
<object> |
States the web address (URL) of the resource the object will utilize. |
data-* |
Global Attributes |
Utilized for keeping personalized information exclusive to the webpage or application. |
datetime |
<del>, <ins>, <time> |
Provides exact date and time information. |
default |
<track> |
Indicates that track will be turned on if the user's choices don't show that a different track would be better. |
defer |
<script> |
Indicates that the code runs after the webpage is done being read (for external scripts only). |
dir |
Global Attributes |
Indicates the way text flows within an element. |
dirname |
<input>, <textarea> |
Indicates that the orientation of the text will be sent. |
disabled |
<button>, <fieldset>, <input>, <optgroup>, <option>, <select>,
<textarea> |
Indicates that the chosen item or set of items must be deactivated. |
download |
<a>, <area> |
This rule means that when someone clicks the link, the intended file will be downloaded. |
draggable |
Global Attributes |
Indicates if an item can be dragged. |
enctype |
<form> |
This tells how to format form-data for sending to the server (only when using method="post"). |
for |
<label>, <output> |
Indicates which form part(s) a label/calculation is connected to. |
form |
<button>, <fieldset>, <input>, <label>, <meter>, <object>,
<output>, <select>, <textarea> |
This phrase indicates the form's name that the element is a part of. |
formaction |
<button>, <input> |
Tells the form where to send info when submitted. Only for "submit" buttons. |
headers |
<td>, <th> |
Indicates which header cell(s) a cell is connected to. |
height |
<canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> |
Indicates the element's vertical size. |
hidden |
Global Attributes |
Indicates that something is currently unimportant or has become unimportant over time. |
high |
<meter> |
Describes the scope of values that are seen as being large. |
href |
<a>, <area>, <base>, <link> |
States the web address (URL) of the page the link directs to. |
hreflang |
<a>, <area>, <link> |
Indicates the language of the linked file. |
http-equiv |
<meta> |
Gives an HTTP header for the content attribute's data/value. |
id |
Global Attributes |
Assigns a special code to an item |
ismap |
<img> |
Describes an image for a server-based map. |
kind |
<track> |
Describes the type of written content. |
label |
<track>, <option>, <optgroup> |
Indicates the name of the song or text passage. |
lang |
Global Attributes |
Indicates the language of the element's text. |
list |
<input> |
Describes a '<datalist>' box with preset choices for an '<input>' box. |
loop |
<audio>, <video> |
Indicates that the audio/video will replay from the beginning each time it ends. |
low |
<meter> |
Describes the scope of numbers seen as small. |
max |
<input>, <meter>, <progress> |
Describes the highest possible value. |
maxlength |
<input>, <textarea> |
Indicates the highest character limit for an element. |
media |
<a>, <area>, <link>, <source>, <style> |
Describes which media/device a linked document is best for. |
method |
<form> |
Indicates the way to send form-data using HTTP. |
min |
<input>, <meter> |
States the smallest value |
multiple |
<input>, <select> |
Allows users to input multiple values. |
muted |
<video>, <audio> |
Indicates that the sound from the video must be turned off. |
name |
<button>, <fieldset>, <form>, <iframe>, <input>, <map>, <meta>,
<object>, <output>, <param>, <select>, <textarea> |
States the element's name. |
novalidate |
<form> |
Indicates that the form won't be checked when it's sent. |
onabort |
<audio>, <embed>, <img>, <object>, <video> |
Script to be executed on abort |
onafterprint |
<body> |
Script to be run after the code is executed |
onbeforeprint |
<body> |
Script to be executed before the document is printed |
onbeforeunload |
<body> |
Code to run when the document is about to be unloaded. |
onblur |
All visible elements. |
Code to execute when an element no longer has focus |
oncanplay |
<audio>, <embed>, <object>, <video> |
Code to execute when a file is prepared to start playing (once enough data is buffered). |
oncanplaythrough |
<audio>, <video> |
Code for playing a file smoothly without buffering interruptions. |
onchange |
All visible elements. |
Code to Execute When Element Value Changes. |
onclick |
All visible elements. |
Code to run when the element is clicked. |
oncontextmenu |
All visible elements. |
Code to Execute When Context Menu is Activated |
oncopy |
All visible elements. |
Code to Execute When Element Content is Being Copied |
oncuechange |
<track> |
Code to execute when the cue changes in a <track> element |
oncut |
All visible elements. |
Code to execute when the text inside an element is being cut |
ondblclick |
All visible elements. |
Code to execute when a user double-clicks on an element |
ondrag |
All visible elements. |
Code to execute while an element is being dragged |
ondragend |
All visible elements. |
Code to execute after a drag action is completed |
ondragenter |
All visible elements. |
Code to execute when a thing is moved and placed onto the correct area |
ondragleave |
All visible elements. |
Code to execute when an item is removed from an acceptable drop location |
ondragover |
All visible elements. |
Code to execute when an item is moved over a valid destination |
ondragstart |
All visible elements. |
Code to run when starting a drag operation. |
ondrop |
All visible elements. |
Code to execute when a dragged item is released |
ondurationchange |
<audio>, <video> |
Code to execute when the media length changes |
onemptied |
<audio>, <video> |
Script acts when a problem occurs and a file becomes unavailable due to an unexpected disconnection |
onended |
<audio>, <video> |
Code to run when media playback is complete. |
onerror |
<audio>, <body>, <embed>, <img>, <object>, <script>, <style>, <video> |
Code to Execute When an Error Happens |
onfocus |
All visible elements. |
Code to execute when an element gains focus. |
onhashchange |
<body> |
Script that can be run when changes have been made to the anchor part of a URL |
oninput |
All visible elements. |
Code to execute when an element receives user input. |
oninvalid |
All visible elements. |
Code to execute when an element is not valid. |
onkeydown |
All visible elements. |
Code to Execute When User Presses a Key. |
onkeypress |
All visible elements. |
Code to Execute When a User Presses a Key. |
onkeyup |
All visible elements. |
Code to Execute When a User Releases a Key. |
onload |
<body>, <iframe>, <img>, <input>, <link>, <script>, <style> |
Code to Execute When Element Finishes Loading. |
onloadeddata |
<audio>, <video> |
Code to Execute When Media Data is Loaded. |
onloadedmetadata |
<audio>, <video> |
Code to execute when metadata (such as size and length) is loaded. |
onloadstart |
<audio>, <video> |
Code to run at the start of a file's loading process, before any content loads. |
onmousedown |
All visible elements. |
Code to execute when a mouse button is clicked on an element. |
onmousemove |
All visible elements. |
Code to run as long as the mouse pointer moves over an element. |
onmouseout |
All visible elements. |
Script that will run when a mouse pointer moves out of an element. |
onmouseover |
All visible elements. |
Code to Execute When Mouse Pointer Moves Over an Element. |
onmouseup |
All visible elements. |
Code to execute when a mouse button is let go on an element. |
onmousewheel |
All visible elements. |
Code for detecting mouse wheel scrolling over an element. |
onoffline |
<body> |
Script runs when the browser goes offline. |
ononline |
<body> |
Code to execute when the browser connects to the internet. |
onpagehide |
<body> |
Code to execute when a user leaves a webpage. |
onpageshow |
<body> |
Code to run when a user visits a webpage. |
onpaste |
All visible elements. |
Code to execute when a user pastes content into an element. |
onpause |
<audio>, <video> |
Code to Execute When Media is Paused. |
onplay |
<audio>, <video> |
Code to execute once the media begins playing. |
onplaying |
<audio>, <video> |
Code to execute once media playback begins. |
onpopstate |
<body> |
Code to execute when the browsing history of a window changes. |
onprogress |
<audio>, <video> |
Code to execute when the browser is fetching media content. |
onratechange |
<audio>, <video> |
Code to execute whenever the playback speed changes, such as when a user shifts to slow motion or fast forward mode. |
onreset |
<form> |
Code to execute when a reset button in a form is pressed. |
onresize |
<body> |
Code to execute when the size of the web browser window changes. |
onscroll |
All visible elements. |
Code to be executed when the scrollbar of an element is being moved. |
onsearch |
<input> |
Code to run when a user types something in a search box (like the ones with
<input type="search">) |
onseeked |
<audio>, <video> |
Code to run when the seeking attribute is changed to false, which means that seeking has finished. |
onseeking |
<audio>, <video> |
Code to be executed when the "seeking" attribute is switched to true, indicating that the process of seeking is ongoing. |
onselect |
All visible elements. |
Code to run when the item is chosen. |
onstalled |
<audio>, <video> |
Code to run when the web browser can't get the pictures or videos for any reason. |
onstorage |
<body> |
Code to execute when a change happens in a Web Storage area. |
onsubmit |
<form> |
Code to be executed when a form is sent. |
onsuspend |
<audio>, <video> |
Code to execute when the process of getting media information is halted before it's fully loaded, regardless of the cause. |
ontimeupdate |
<audio>, <video> |
Run this script when the part you're watching changes (for example, when you skip ahead to a different point in the video). |
ontoggle |
<details> |
Code to execute when the user opens or closes the<details> section. |
onunload |
<body> |
Code to run when a webpage finishes closing or when the internet window is closed. |
onvolumechange |
<audio>, <video> |
Code to be executed whenever the volume of a video or audio is adjusted. |
onwaiting |
<audio>, <video> |
Run this script when the media stops temporarily to get more data (like when it's loading) but is supposed to start again. |
onwheel |
All visible elements. |
Code to execute when the mouse wheel moves up or down on top of an element. |
open |
<details> |
States that the information must be clear and able to be seen by the user. |
optimum |
<meter> |
States the best value for the gauge. |
pattern |
<input> |
Describes a pattern that is used to check if the value of an <input> element is correct. |
placeholder |
<input>, <textarea> |
Describes a quick tip that tells you what to expect from the element. |
poster |
<video> |
Indicates a picture to display while the video is being loaded, or until the user presses the play button. |
preload |
<audio>, <video> |
Tells us if and how the writer wants the sound/video to start playing when the webpage opens. |
readonly |
<input>, <textarea> |
States that the item can't be changed. |
rel |
<a>, <area>,
<form>, <link> |
Describes how the current document is connected to the linked document. |
required |
<input>, <select>, <textarea> |
Indicates that you need to complete the item before you can submit the form. |
reversed |
<ol> |
States that the list needs to be arranged in a way where the numbers go from highest to lowest (9, 8, 7...). |
rows |
<textarea> |
Tells you how many lines you can see in a text box. |
rowspan |
<td>, <th> |
Says how many rows a cell in a table should cover. |
sandbox |
<iframe> |
Adds more rules for the stuff inside an <iframe> |
scope |
<th> |
Indicates if a header cell is for a column, row, or a bunch of columns or rows. |
selected |
<option> |
Indicates that a choice should already be chosen when the webpage loads. |
shape |
<area> |
Describes the form of the region. |
size |
<input>, <select> |
States how many characters wide an input field should be (for <input>) or how many choices should be visible in a dropdown (for <select>) |
sizes |
<img>, <link>,
<source> |
Indicates how big the linked item is. |
span |
<col>, <colgroup> |
Indicates how many columns to stretch across. |
spellcheck |
Global Attributes |
Indicates if the item should undergo a check for correct spelling and grammar or not. |
src |
<audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>,
<video> |
States the web address of the media file. |
srcdoc |
<iframe> |
States what should be displayed inside the <iframe> on the page using HTML content. |
srclang |
<track> |
Indicates the language of the text on the track (necessary if type="subtitles"). |
srcset |
<img>, <source> |
Indicates the web address of the picture to use in various situations. |
start |
<ol> |
Tells you where an ordered list begins. |
step |
<input> |
Defines the allowed range of numbers for an input box according to the law. |
style |
Global Attributes |
Defines a style inside an HTML element using CSS. |
tabindex |
Global Attributes |
Indicates the order in which you move between different parts of something by pressing the "Tab" key. |
target |
<a>, <area>, <base>, <form> |
Indicates where to open a linked document or where to send a form. |
title |
Global Attributes |
Gives more details about something. |
translate |
Global Attributes |
Indicates if the stuff inside an element should be changed into another language or not. |
type |
<a>, <button>, <embed>, <input>, <link>, <menu>, <object>, <script>,
<source>, <style> |
Explains the category of object. |
usemap |
<img>, <object> |
Indicates that an image is used as a map on the user's side. |
value |
<button>, <input>, <li>, <option>,
<meter>, <progress>, <param> |
States the worth of the item.t |
width |
<canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> |
Defines how wide the object is. |
wrap |
<textarea> |
Describes how the text inside a text box should be arranged when it's sent through a form. |