
HTML elements have attributes. These these are additional values that can be applied to the elements that configure or adjust their behavior.
abbr
- Used with: <input>
- The
abbrAttribute specifies a short abbreviated description or alternative label for the header cell. accept
- Used with: <input>
- The
acceptAttribute specifies the file types accepted by thefileupload control. accept-charset
- Used with: <form>
- The
accept-charsetAttribute specifies the character encoding to be used for a<form>submission. accesskey
- Used with: Global Attributes
- The
accesskeyAttribute allows you to specify a keyboard shortcut to focus or activate a specific element. action
- Used with: <form>
- The
actionAttribute specifies the URL where the<form>data is sent on submission. allow
- Used with: <input>
- The allow attribute specifies a permissions policy to define what permissions are available to an iframe.
alt
- Used with: <area> <img> <input>
- The
altattribute specifies the alternative text to be used if the element it is representing is not displayed. async
- Used with: <script>
- The
asyncattribute is a boolean that determines whether the script should be fetched asynchronously. autocomplete
- Used with: <form> <input>
- The
autocompleteattribute specifies whether the browser can automatically populate<input><form>elements. autofocus
- Used with: <button> <input> <select> <textarea>
- The
autofocusattribute specifies whether the<element>should be auto-focused when the page document loads. autoplay
- Used with: <audio> <video>
- The
autoplayattribute is a boolean that specifies whether the audio or video should begin to play automatically as soon as it starts to download. charset
- Used with: <meta>
- The
charsetattribute specifies the character encoding for the HTML document. checked
- Used with: <input>
- The
checkedattribute is a boolean that specifies whether the<input>control should be pre-selected. cite
- Used with: <blockquote> <del> <ins> <q>
- The
citeattribute’s usage depends on its element. For instance, it could represent the URL of the source of a quotation or an URL or URL fragment pointing to the reasons for inserting or deleting text. class
- Used with: Global Attributes
- The
classglobal attribute specifies one or more class names for an HTML element. cols
- Used with: <textarea>
- The
colsattribute specifies the maximum number of characters per line in the<textarea>element. colspan
- Used with: <td> <th>
- The
colspanattribute specifies the number of columns in a<table>element the<td>cell extends. content
- Used with: <meta>
- The
contentattribute specifies the name for thehttp-equivornameattribute, depending on which is used. contenteditable
- Used with: Global Attributes
- The
contenteditableattribute specifies whether an element should be editable by the user. controls
- Used with: <audio> <video>
- The
controlsattribute specifies whether to display the default browser video or audio player enabling the user to stop or start the playback, change the volume, and position seek. coords
- Used with: <area>
- The
coordsattribute details the coordinates of the relevantshapeattribute. data
- Used with: <object>
- The
dataattribute specifies the URL of the resource to display in the<object>element. datetime
- Used with: <del> <ins> <time>
- The
datetimeattribute specifies a date, time, or both in a machine-readable format. default
- Used with: <track>
- The
defaultattribute, when used with the<track>element, specifies that the text track should be enabled. defer
- Used with: <script>
- The
deferattribute is a boolean that determines whether a script should be fetched only after the HTML has been parsed. dirname
- Used with: <input> <textarea>
- The
dirnameAttribute on a form control element allows the submission of the element’s directionality along with the form data. disabled
- Used with: <button> <fieldset> <input> <optgroup> <option> <select> <textarea>
- The
disabledAttribute is a boolean that is used to disable form controls, such as buttons, inputs, options and more. download
- Used with: <a> <area>
- The
downloadAttribute specifies that the target will be downloaded rather than followed. You can add an optional value specifying the name of the downloaded file. draggable
- Used with: Global Attributes
- The
draggableAttribute specifies whether the element can be dragged either via native browser functionality, or with the Drag and Drop API. enctype
- Used with: <form>
- The
enctypeAttribute specifies how to encode the form on submission formethod="post"HTTP methods. for
- Used with: <label> <output>
- The
forAttribute specifies the id of a form element a label is bound to, or references the id attribute of an element to be used in a calculation. form
- Used with: <button> <fieldset> <input> <label> <meter> <object> <output> <select> <textarea>
- The
formAttribute allows you to associate form elements to a form even if they are positioned outside the form element. formaction
- Used with: <button> <input>
- The
formactionAttribute specifies the URL that processes the information submitted by the form. formenctype
- Used with: <button> <input>
- The
formenctypeAttribute specifies the method of encoding of information sent to a server for forms withtype=submit. formmethod
- Used with: <button> <input>
- The
formmethodAttribute specifies the method of encoding of information sent to a server for forms withtype=submit. formnovalidate
- Used with: <button> <input>
- The
formnovalidateAttribute specifies whether to validate the form when submitted. formtarget
- Used with: <button> <input>
The
formtargetAttribute specifies where to display the response after submitting the form where thetype="submit".If specified, it overrides the target attribute of the
<form>element.headers
- Used with: <td> <th>
- The
headersAttribute allows you to assign one or more headers to a particular cell. height
- Used with: <canvas> <embed> <iframe> <img> <input> <object> <video>
- The
heightAttribute specifies the height of the element in pixels. hidden
- Used with: Global Attributes
- The hidden attribute is a boolean that specifies that an element is not relevant and should not be displayed by the browser.
high
- Used with: <meter>
- The
highAttribute is used with a<meter>element to specify a level over which the value is considered too high. href
- Used with: <a> <area> <base> <link>
The
hrefAttribute specifies an URL that the element can use. For instance:<a>and<area>elements - it specifies the URL of the page the link goes to.<base>elements - it sets a base URL to be used for relative URLs on a page.<link>elements - it specifies the the URL of the external resource.
hreflang
- Used with: <a> <area> <link>
- The
hreflangAttribute specifies the language of the linked document. Its use is purely advisory. http equiv
- Used with: <meta>
- The
http equivAttribute specifies how the element deals with cross-origin requests. integrity
- Used with: Global Attributes
- The
integrityAttribute is used with a<script>element to enable a browser (or other user agents) to verify that a fetched resource has not been manipulated. ismap
- Used with: <img>
- The
ismapAttribute is a boolean that specifies an image as a server-side map. This attribute is only permitted where the<img>element is a descendant of an<a>element with ahrefattribute. kind
- Used with: <track>
- The
kindAttribute specifies the kind of text track to use with an<audio>or<video>element. label
- Used with: <track> <option> <optgroup>
- The
labelAttribute specifies specifies specifies a user-readable label. list
- Used with: <input>
- The
listAttribute specifies theidof the<datalist>element that contains a list of pre-defined options for an<input>element. loading
- Used with: <img>
- The
loadingAttribute specifies whether an image should be loaded immediately or delayed until it reaches a certain distance from the viewport. loop
- Used with: <audio> <video>
- The
loopAttribute is a boolean attribute that makes an audio or video track automatically start from the beginning once it reaches the end. low
- Used with: <meter>
- The
lowAttribute is used with a<meter>element to specify a level under which the value is considered too low. maxlength
- Used with: <input> <textarea>
- The
maxlengthAttribute specifies the maximum number of characters allowed. media
- Used with: <a> <area> <link> <source> <style>
- The
mediaAttribute specifies the media or device the target link is optimized for, such as mobile devices or print. minlength
- Used with: <input> <textarea>
- The
minlengthAttribute specifies the minimum number of characters allowed. multiple
- Used with: <input> <select>
- The
multipleAttribute specifies that more than one value may be entered. muted
- Used with: <video> <audio>
- The
mutedAttribute specifies whether to start the audio or video with no sound. name
- Used with: <button> <fieldset> <form> <iframe> <input> <map> <meta> <object> <output> <param> <select> <textarea>
- The
nameAttribute specifies the name of the element. It is submitted to the server along with the value as part of the form data. nomodule
- Used with: <script>
- The
nomoduleAttribute is a boolean that determines whether to execute the script in browsers that support ES2015 modules. This is used as a fallback to server alternative script should the browser not support modular JavaScript code. novalidate
- Used with: <form>
- The
novalidateAttribute is a boolean that indicates whether the form should not be validated on submission. If the attribute is omitted, then validation is undertaken. open
- Used with: <details>
- The
openAttribute is a boolean attribute, which, if present, indicates that both the summary and detail information should be shown to the user. optimum
- Used with: <meter>
- The
optimumAttribute specifies the optimum or good value of a<meter>element. pattern
- Used with: <input>
- The
patternAttribute specifies a regular expression that the value of the<input>element will be validated against. ping
- Used with: <a> <area>
- The
pingAttribute can take a string of URLs, with a single space as the separator. When the link is clicked, a POST request will be sent to the URLs with the body ping. placeholder
- Used with: <input> <textarea>
- The
placeholderAttribute specifies an expected value or default text that will display inside a<input>or<textarea>element. When a user starts typing, the placeholder will disappear. poster
- Used with: <video>
- The
posterAttribute specifies an URL for an image to show while the video is downloading. preload
- Used with: <audio> <video>
- The
preloadAttribute specifies whether the browser should preload the audio or video file. readonly
- Used with: <input> <textarea>
- The
readonlyAttribute is a boolean that specifies that the<input>or<textarea>element is read-only. rel
- Used with: <a> <area> <form> <link>
- The
relAttribute specifies the relationship between two documents. required
- Used with: <input> <select> <textarea>
- The
requiredAttribute is a boolean that specifies the form element is required to be completed prior to submission. reversed
- Used with: <ol>
- The
reversedAttribute is a boolean that specifies that the list items are in reverse order. rows
- Used with: <textarea>
- The
rowsAttribute specifies the number of visible lines in the<text area>element. rowspan
- Used with: <td> <th>
- The
rowspanAttribute specifies the number of rows that the cell should span. sandbox
- Used with: <iframe>
- The
sandboxAttribute enables a range of restrictions for the content within an iframe. It can be empty for the full set of restrictions or be a space-separated list of pre-defined values that remove those particular restrictions. scope
- Used with: <th>
- The
scopeAttribute specifies whether the header cell is a header for a column, row, group of rows, or groups of columns. selected
- Used with: <option>
- The
selectedAttribute is a boolean that indicates whether the option is the default selected when the page loads. shape
- Used with: <area>
- The
shapeAttribute details the shape of the hotspot areas of anareaelement. sizes
- Used with: <img> <link> <source>
- The
sizesAttribute specifies the image sizes between breakpoints. It is used in combination with a media condition. span
- Used with: <col> <colgroup>
- The
spanAttribute specifies the number of columns that the<col>or<colgroup>element should span. spellcheck
- Used with: Global Attributes
- The
spellcheckAttribute specifies whether the element should have its spelling and grammar checked. src
- Used with: <audio> <embed> <iframe> <img> <input> <script> <source> <track> <video>
- The
srcAttribute specifies the URL of an external resource. srcdoc
- Used with: <iframe>
- The
srcdocAttribute specifies the HTML code or content to be embedded in the<iframe>. srclang
- Used with: <track>
- The
srclangAttribute specifies the language of the track’s text data. It is a required attribute when the kind attribute value is subtitles. srcset
- Used with: <img> <source>
- The
srcsetAttribute specifies an URL to an image along with a width descriptor (positive integer followed by w), or a pixel density descriptor (a number followed by x). It determines the set of images the browser can choose from with each image being a different size. The width or density descriptor is based upon the image’s real size. start
- Used with: <ol>
- The
startAttribute specifies a number from which you wish an ordered list to start. tabindex
- Used with: Global Attributes
- The
tabindexAttribute specifies that its element can be focused the order it can be tabbed when navigating. target
- Used with: <a> <area> <base> <form>
- The
targetAttribute specifies how to open the linked document. title
- Used with: Global Attributes
- The
titleAttribute specifies additional information about an element, commonly in the form of a tooltip when the mouse hovers over the element. translate
- Used with: Global Attributes
- The
translateAttribute specifies whether the element should be translated or not when a page is localized, for example by Google Translate. type
- Used with: <a> <button> <embed> <input> <link> <object> <script> <source> <style>
- The
typeAttributehints at the MIME type of the destination document. It has no effect and is purely advisory. usemap
- Used with: <img> <object>
- The
usemapAttribute specifies whether the image is to be used as part of an image map. value
- Used with: <button> <input> <li> <option> <meter> <progress> <param>
- The
valueAttribute specifies a value to be used with its element. Usage varies depending on the element used. width
- Used with: <canvas> <embed> <iframe> <img> <input> <object> <video>
- The
widthAttribute specifies the width of the element in pixels. wrap
- Used with: <textarea>
- The
wrapAttribute specifies whether the browser will automatically insert line breaks when text is entered into the<textarea>element.