HTML attributes list
Attributes make the elements more usable. HTML elements represent different behaviour on different attributes. They are always used in the starting tag. The syntax to write an attribute is given below.
<div attribute-name=attribute-value></div>
<div title=html></div>
Attributes | Description |
---|---|
abbr | the alternative text for the header cell in short or expanded form. |
accept | suggests the input control what kind of file will be accepted. |
accept-charset | defines character encodings to be used for form submission. |
accesskey | control using keyboard shortcuts to active an element. |
action | location (URL) for form submission. |
alt | alternate text when the image is not visible. |
async | It executes script asynchronously. |
autocomplete | browser suggests different options to the user for autofill feature. |
autofocus | It automatically focuses the control to the specified input field when the page is loaded. |
autoplay | It playbacks the media when a page is loaded. |
border | defines a border for the table. |
challenge | A kind of string to package with the generated public key. |
charset | character encoding to store or transmit |
checked | The input control is selected by default. |
cite | citation link to the original source of quoted text. |
class | Used to include CSS properties to style an element. |
cols | defines the width or no. of characters per line. |
colspan | This attribute allows a cell to contain or span more than one column in a table. |
content | The corresponding value of name in <meta> element.It may be keywords, description etc. |
contenteditable | It allows any element to edit content. |
controls | represents controls for the media such as play/pause, volume control. |
coords | Specifies coordinates to specify an area on the image. |
crossorigin | describes how to manage cross-origin requests. |
data | Location (address) of the resource to embed in an <object> element. |
datetime | machine-readable value of time and date. |
deault | Activates the track if the other text track is not appropriate. |
defer | defers the script execution. |
dir | specifies the directionality of the element. |
disabled | It makes the input field uneditable and unprocessable. |
download | downloads the linked file and value of the attribute is a default file name for the downloaded file in local server. |
enctype | represents the encoding type for the form submission. |
for | It associates the <label> element with the form control. |
formaction | Location or address for the form submission where form is processed. |
formenctype | character encoding set to store or use for the form submission. |
formmethod | HTTP to use for form submission. "GET" or "POST" |
formnovalidate | submits the form without validation. |
formtarget | represents the browsing mode for form submission. |
height | Height (vertical dimension) of the visual content for the corresponding element. |
hidden | specifies that the content is not yet relevant. |
high | defines the low limit of the high range. |
href | represents the address (URL) of the hyperlink. |
hreflang | represents the language of the linked document. |
http-equiv | pragma directive used in <meta> element. |
id | defines a unique id for the HTML element. |
ismap | provides access to the server-side image map. |
kind | one kind of text track. |
label | represents user visible-label (name) of a group of options. |
lang | specifies a language for the element. |
list | represents the list of pre-defined options linked with another element. |
loop | The media seeks back to the start upon reaching at the end. |
low | specifies the high limit of the low range values. |
max | represents maximum value or range. |
maxlength | specifies the maximum length of the value. Actually, it is the maximum number of characters. |
media | valid media to which some properties are applied. |
method | HTTP method for form submission. |
min | represents minimum value or range. |
minlength | represents minimum length or value. Actually, it is the minimum number of characters. |
multiple | It allows multiple values to select or save. |
muted | The audio stream is muted by deault. |
name | name of the form control to process after submission. |
novalidate | submits the form without validation. |
optimum | represents optimum value. It is less than the maximum value and greater than the minimum value. |
pattern | pattern to be matched by the user entered value in an input field. |
placeholder | watermark label of text visible to the user in a form control. |
poster | An image shown prior to video playback. |
preload | specifies how much buffering the media resource needs. |
readonly | the user can only read the value in an element. |
rel | relationship between the current page and linked document. |
required | This attribute forces the user to enter the value in the form control. |
reversed | numbers the list items backward in an ordered list |
rows | represents height (no of lines to show) of the textarea. |
rowspan | It allows a cell to span more than one rows in a table. |
sandbox | |
spellcheck | This attribute tracks and underlines the spelling mistakes. |
selected | An option is selected by default in a list of options. |
shape | image map created on the image. |
size | size of the form control. |
sizes | represents the sizes of icons for visual media. |
span | spans more than one columns. |
src | Location (URL) of the external resource. |
start | custom starting value for the ordered list. |
step | This attribute increments or decrements the same value in an input field. |
style | This attribute styles the visual HTML element using CSS properties. |
tabindex | decides the focus of element and the relative order of sequential navigation. |
target | Browsing mode for a hyperlink. |
title | specifies a title for the element. |
translate | whether to translate the HTML element or not. |
type | defines the type of the linked resource. |
typemustmatch | the type attribute and content-type value of embedded resource must match to use. |
usemap | name of the image map to use. |
value | represents value in an input field to be processed. |
width | represents the width (horizontal dimension) of the visual content. |
wrap | How the value of input control is wrapped. |
Was this article helpful?