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>

AttributesDescription
abbrthe alternative text for the header cell in short or expanded form.
acceptsuggests the input control what kind of file will be accepted.
accept-charsetdefines character encodings to be used for form submission.
accesskeycontrol using keyboard shortcuts to active an element.
actionlocation (URL) for form submission.
altalternate text when the image is not visible.
asyncIt executes script asynchronously.
autocompletebrowser suggests different options to the user for autofill feature.
autofocusIt automatically focuses the control to the specified input field when the page is loaded.
autoplayIt playbacks the media when a page is loaded.
borderdefines a border for the table.
challengeA kind of string to package with the generated public key.
charsetcharacter encoding to store or transmit
checkedThe input control is selected by default.
citecitation link to the original source of quoted text.
classUsed to include CSS properties to style an element.
colsdefines the width or no. of characters per line.
colspanThis attribute allows a cell to contain or span more than one column in a table.
contentThe corresponding value of name in <meta> element.It may be keywords, description etc.
contenteditableIt allows any element to edit content.
controlsrepresents controls for the media such as play/pause, volume control.
coordsSpecifies coordinates to specify an area on the image.
crossorigindescribes how to manage cross-origin requests.
dataLocation (address) of the resource to embed in an <object> element.
datetimemachine-readable value of time and date.
deaultActivates the track if the other text track is not appropriate.
deferdefers the script execution.
dirspecifies the directionality of the element.
disabledIt makes the input field uneditable and unprocessable.
downloaddownloads the linked file and value of the attribute is a default file name for the downloaded file in local server.
enctyperepresents the encoding type for the form submission.
forIt associates the <label> element with the form control.
formactionLocation or address for the form submission where form is processed.
formenctypecharacter encoding set to store or use for the form submission.
formmethodHTTP to use for form submission. "GET" or "POST"
formnovalidatesubmits the form without validation.
formtargetrepresents the browsing mode for form submission.
heightHeight (vertical dimension) of the visual content for the corresponding element.
hiddenspecifies that the content is not yet relevant.
highdefines the low limit of the high range.
hrefrepresents the address (URL) of the hyperlink.
hreflangrepresents the language of the linked document.
http-equivpragma directive used in <meta> element.
iddefines a unique id for the HTML element.
ismapprovides access to the server-side image map.
kindone kind of text track.
labelrepresents user visible-label (name) of a group of options.
langspecifies a language for the element.
listrepresents the list of pre-defined options linked with another element.
loopThe media seeks back to the start upon reaching at the end.
lowspecifies the high limit of the low range values.
maxrepresents maximum value or range.
maxlengthspecifies the maximum length of the value. Actually, it is the maximum number of characters.
mediavalid media to which some properties are applied.
methodHTTP method for form submission.
minrepresents minimum value or range.
minlengthrepresents minimum length or value. Actually, it is the minimum number of characters.
multipleIt allows multiple values to select or save.
mutedThe audio stream is muted by deault.
namename of the form control to process after submission.
novalidatesubmits the form without validation.
optimumrepresents optimum value. It is less than the maximum value and greater than the minimum value.
patternpattern to be matched by the user entered value in an input field.
placeholderwatermark label of text visible to the user in a form control.
posterAn image shown prior to video playback.
preloadspecifies how much buffering the media resource needs.
readonlythe user can only read the value in an element.
relrelationship between the current page and linked document.
requiredThis attribute forces the user to enter the value in the form control.
reversednumbers the list items backward in an ordered list
rowsrepresents height (no of lines to show) of the textarea.
rowspanIt allows a cell to span more than one rows in a table.
sandbox
spellcheckThis attribute tracks and underlines the spelling mistakes.
selectedAn option is selected by default in a list of options.
shapeimage map created on the image.
sizesize of the form control.
sizesrepresents the sizes of icons for visual media.
spanspans more than one columns.
srcLocation (URL) of the external resource.
startcustom starting value for the ordered list.
stepThis attribute increments or decrements the same value in an input field.
styleThis attribute styles the visual HTML element using CSS properties.
tabindexdecides the focus of element and the relative order of sequential navigation.
targetBrowsing mode for a hyperlink.
titlespecifies a title for the element.
translatewhether to translate the HTML element or not.
typedefines the type of the linked resource.
typemustmatchthe type attribute and content-type value of embedded resource must match to use.
usemapname of the image map to use.
valuerepresents value in an input field to be processed.
widthrepresents the width (horizontal dimension) of the visual content.
wrapHow the value of input control is wrapped.

Was this article helpful?