HTML Attributes List

List  of HTML Attributes specifying the tag(s) for which each attribute is used:


AttributeDescriptionUsed with Tag(s)
acceptUsed with <input> element only.<input>
accept-charsetDefine character encoding for form submission.<form>
accesskeyKeyboard shortcut to activate/focus elements.Various
actionSpecify where form data is sent after submission.<form>
alignSpecify alignment of text content.Deprecated
altShow/display something if primary attribute isn't displayed.<img>, <area>
asyncWorks only for external scripts (when src is present).<script>
autocompleteSpecify whether input field should autocomplete.<input>
autoplayAudio/video should automatically start playing on page load.<audio>, <video>
autofocusElement should be focused on page load.Various
bgcolorSet background color of an HTML element.Deprecated
borderSet visible border width for elements within body.Various
charsetDefine character encoding.<meta>
checkedIndicate if element should be checked on page load.<input>
citeSpecify URL of document explaining quotes/message.<blockquote>, <q>
classSpecify one or more class names for an element.Various
colsNumber of columns a cell should span.<td>, <th>
colspanNumber of columns a cell should span.<td>, <th>
contentValues related to http-equiv or name attribute.<meta>
contenteditableSpecify if content in element is editable.Various
controlsBoolean attribute, new in HTML5.<audio>, <video>
coordsSpecify coordinates of an area in an image map.<area>
dataSpecify URL of embedded file of Object.<object>, <link>
data-*HTML5 attribute for custom data.Various
datetimeSpecify date and time of inserted and deleted text.<del>, <ins>
defaultSpecify track enabled if user preferences don't suggest otherwise.<track>
deferExecute when page has finished parsing.<script>
dirText direction of element content.Various
dirnameEnable text direction of input/textarea after form submission.<input>, <textarea>
disabledIndicate if element is disabled.Various
downloadDownload element when user clicks hyperlink.<a>, <area>
draggableSpecify if element is draggable.Various
dropzoneSpecify how dragged data behaves when dropped.Various
enctypeData present in form, encoded when submitted to server.<form>
forUsed in both <label> and <output> elements.<label>, <output>
formElement can contain one or more forms.Various
formactionSpecify where form data is sent. Called after form submission.<button>, <input>
headersSpecify header cells a table cell is related to.<th>, <td>
heightSpecify height of element.<img>, <canvas>, <iframe>
hiddenDefine visibility of elements.Various
highRange where gauge value is considered high.<meter>
hrefSpecify URL of document.<a>, <link>
hreflangLanguage for linked document.<a>, <link>
http-equivProvide header info or value of content attribute.<meta>
idUsed by CSS and JavaScript for specific tasks.Various
ismapBoolean attribute for image maps.<img>
kindKind of track (used in <track>).<track>
labelTitle of Text Track, used by browser when listing available tracks.<track>
langSpecify language of element content.Various
listPre-defined options for <input> to suggest user.<input>
loopRestart audio/video after finishing.<audio>, <video>
lowRange where gauge value is considered low.<meter>
maxSpecify maximum value of an element.<input>, <meter>, <progress>
maxlengthMaximum number of characters in <input> element.<input>, <textarea>
mediaSpecify media/device for linked document.<a>, <link>, <source>, <style>
methodHTTP method used to send data when submitting form.<form>
minSpecify lower bound of gauge.<input>, <meter>, <progress>
multipleAllow selecting more than one value in an element.<input>
mutedAudio output of video is muted.<video>
nameSpecify name for element.Various
novalidateForm data shouldn't be validated when submitting form.<form>
onblurEvent when element loses focus.Various
oncopyUser copied content in an element.Various
oncutUser cut or deleted content in element.Various
onkeypressEvent when user presses a key on keyboard.Various
onmousedownOrder of events related to onmousedown event.Various
onscrollEvent works when an element's scrollbar is scrolled.Various
optimumOptimal numeric value for gauge.<meter>
patternShort hint for expected value of input field/textarea.<input>
placeholderShort hint for expected value of input field/textarea.<input>, <textarea>
readonlyText in <input> or <textarea> is read-only.<input>, <textarea>
requiredInput element must be filled before submitting form.Various
reversedOrder list in descending order instead of ascending.<ol>
rowsNumber of visible text lines for control (rows to display).<textarea>
rowspanNumber of rows a cell should span.<td>, <th>
selectedSpecify which option is selected by default.<option>
sizeInitial width for input and number of visible rows for select.<input>, <select>
spellcheckApplied to HTML forms using spellcheck attribute.Various
srclangSpecify language of track text.<track>
startStart value for numbering individual list items.<ol>
stepSet discrete step size of <input> element.<input>
styleThree ways of implementing style in HTML.Various
tabindexNavigation using Tab button.Various
targetSpecify where linked document should open.<a>, <form>, <base>, <area>
titleSpecify extra information about element.Various
translateSpecify if content of element is translated.<body>
valueSpecify value of element it's used with.Various
wrapSpecify text wrapping in <textarea> when form submitted.<textarea>

Please note that the "Used with Tag(s)" column provides general information about the tags with which an attribute is commonly used. The list might not be exhaustive, as attributes can sometimes be used with other tags as well.