1. Ultimate Reference to All HTML Attributes

HTML Markup attributes are a special type of instructions that are given to an HTML5 element. Moreover, the attributes depend on HTML tags, and a specific element can have a specific attribute. However, there are certain HTML attributes, which are used as global attributes and can be used with all types of elements. The below table lists all the HTML attributes and acts as an ultimate and up-to-date guide and reference.

Tutorial Contents:

  1. Ultimate Reference to All HTML Attributes
  2. List of All HTML Attributes
  3. Reference Links

2. Search Ultimate Reference For HTML Attributes

The below reference table has all the HTML attributes with an ultimate and up-to-date list that we can utilize in HTML5 markup. Type the name of the attribute and instantly find the associated HTML5 tag or element with that attribute.

2.1. Alphabetical Reference

HTML Attributes Reference
Attribute Tag Name Description
abbr <td>, <th> This HTML attribute specifies the abbreviation and accepts a text value.
accept <form> This HTML attribute restricts the user to select a specific type of file (only for type="file").
accept <input> This HTML attribute restricts the user to select a specific type of file (only for type="file").
accept-charset <form> This HTML attribute defines the character encoding which is used for form submission.
accesskey Global Attribute This HTML attribute creates a shortcut key to focus on an element.
action <form> This HTML attribute specifies the target location to send the form data.
align <applet>, <caption>, <col>, <colgroup>, <iframe>, <img>, <input>, <legend>, <hr>, <div>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <p>, <object>, <table>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr> This HTML attribute was utilized to align the content according to surrounding elements.
alink <body>, <form> This HTML attribute defines the color of the link when a user selects it.
allow <iframe> This HTML attribute declares a feature policy for the iframe element.
allowtransparency <iframe> This HTML attribute defines the transparency of an iframe element.
alt <applet> This HTML attribute defines an alternative text for the applet element.
alt <area>, <img alt="alt-text">, <input> This HTML attribute specifies an alternative text to display when original elements fail to produce the results.
archive <applet>, <object> This HTML attribute specifies a list of URIs separated by spaces.
async <script> This HTML attribute loads an external script asynchronously with the page.
autocapitalize Global Attribute This HTML attribute sets the input automatically capitalize when entered by the user.
autocomplete <form>, <input> This HTML attribute enables or disables the autocomplete features for form elements i.e. whether to show the drop-down list or not.
autofocus <button>, <input>, <select>, <textarea> This HTML attribute enables an element to get in focus on the loading of the page.
autoplay <audio>, <video> This HTML attribute plays the video or audio automatically after getting ready.
axis <td>, <th> This HTML attribute creates a list of related headers separated by commas.
background <body>, <table>, <tbody>, <tfoot>, <td>, <thead>, <th>, <tr> This HTML attribute sets the background image by taking the image URL.
bgcolor <body>, <col>, <colgroup>, <marquee>, <table>, <tr>, <td>, <th>, <body>, <tfoot> This HTML attribute sets the background color of an element.
border <img>, <input>, <object>, <table> This HTML attribute defines the width of the border for an element.
bordercolor <table> This HTML attribute defines the color of the border for an element.
bottommargin <body> This HTML attribute sets the margin at the bottom of the page.
buffered <audio>, <video> This HTML attribute stores the buffered time of an audio or video.
capture <input> This HTML attribute specifies that a new file should be captured and a device to capture that file.
cellpadding <table> This HTML attribute sets the spacing within the cells.
cellspacing <table> This HTML attribute sets the space between the cells.
challenge <keygen> This HTML attribute submits a challenge string along with a public key.
char <col>, <colgroup>, <tbody>, <td> <tfoot>, <th>, <thead>, <tr> This HTML attribute declares a alignment char, e.g. char=':'.
charoff <col>, <colgroup>, <tbody>, <td> <tfoot>, <th>, <thead>, <tr> This HTML attribute sets the offset for the alignment char.
charset <a>, <link>, <meta>, <script> This HTML attribute specifies the character encoding for the current document or external script file.
checked <command>, <input> This HTML attribute makes an input field pre-selected when the page loads.
cite <blockquote>, <del>, <ins>, <q> This HTML attribute is used to cite a quoted text, mark a deleted text, or inserted text.
class Global Attribute except <base>, <basefont>, <head>, <html> <meta>, <param>, <script>, <style>, <title> This HTML attribute adds one or more classes for an element.
classid <object> This HTML attribute identifies the implementation of the URI.
clear <br> This HTML attribute controls the flow of text.
code <applet>, <object> This HTML attribute sets the URL of the applet's class file for loading.
codebase <applet>, <object> This HTML attribute provides the absolute or relative URL of the directory that stores the class files of the applet element.
codetype <object> This HTML attribute tells about the content type of the code attribute.
color <basefont>, <font>, <hr> This HTML element specifies the color of the text of an element.
cols <frameset>, <textarea> This HTML attribute sets the visible width of a textarea by specifying the number of columns.
colspan <td>, <th> This HTML attribute enables a table cell to span to the specified number of columns.
compact <dir>, <dl>, <menu>, <ol>, <ul> This HTML attribute declares the spacing between the items.
content <meta> This HTML attribute sets the value associated with the http-equiv or name attribute
contenteditable Global Attribute This HTML attribute makes the content of an element editable by the user.
contextmenu Global Attribute This HTML attribute defines the ID of a menu element which will serve as the element's context menu.
controls <audio>, <img>, <link>, <script>, <video> This HTML attribute makes the controls of an audio or video player visible.
coords <a> This HTML attribute set the coordinates of an area.
coords <area> This HTML attribute set the coordinates of an area.
crossorigin <a>, <area> This HTML attribute defines the behavior of an element and how it controls the cross-origin requests.
csp <a>, <area> This HTML attribute specifies the Content Security Policy to follow for an embedded document.
data <object> This HTML attribute defines the URL of the resource and makes it usable by the object.
data-* Global Attribute This HTML attribute allows attaching custom attributes to an element.
datapagesize <table> This HTML attribute is unnecessary for the table element.
datasrc <a>, <button>, <div>, <frame>, <iframe>, <img>, <input>, <label>, <legend>, <marquee>, <object>, <option>, <select>, <span>, <table>, <textarea> This HTML attribute declares the identifier of the data source that is linked to the element.
datafld <a>, <button>, <div>, <fieldset>, <frame>, <iframe>, <img>, <input>, <label>, <legend>, <marquee>, <object>, <select>, <span>, <textarea> This HTML attribute defines the XML note that will be placed inside the HTML element.
dataformatas <button>, <div>, <input>, <label>, <legend>, <marquee>, <object>, <select>, <span>, <table> This HTML attribute declares the rules of how data will be rendered.
datetime <del>, <ins>, <time> This HTML attribute attaches the date and time of an event to an element.
declare <object> This HTML attribute declares the object but does not instantiate it.
decoding <img> This HTML attribute includes the decoding preference for an image.
default <track> This HTML attribute sets the default subtitle track for a video.
defer <script> This HTML attribute loads the external script after the page is loaded.
dir Global Attribute except <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, <script> This HTML attribute declares the direction of the text in an element.
dirname <input>, <textarea> This HTML attribute also submits the direction of the field along with the form.
disabled <button>, <command>, <fieldset>, <input>, <keygen>, <optgroup>, <option>, <select>, <textarea> This HTML attribute disables an element and prohibits user interaction.
download <a>, <area> This HTML attribute downloads the resource that is linked upon clicking the hyperlink.
draggable Global Attribute This HTML attribute makes an element draggable on the screen if it is set to "true".
dropzone All Elements This HTML attribute specifies instructions for the dragged data to copy, move, or link upon dropping.
enctype <form> This HTML attribute defines the encoding or content type of the data when a form is submitted by the "post" method.
enterkeyhint <textarea>, <contenteditable> This HTML attribute defines the action label (or icon) to display for the enter key on virtual keyboards.
event <script> This HTML attribute sets or retrieves the event for which the script is written.
face <basefont>, <font> This HTML attribute defines a list of font names separated by commas.
for <script> This HTML attribute sets or retrieves the object that is bound to the event script.
for <label>, <output> This HTML attribute tells the association of the label or output tag to another element.
form <button>, <fieldset>, <input>, <keygen>, <label>, <meter>, <object>, <output>, <progress>, <select>, <textarea> This HTML attribute contains the name of the <form> to which the current element is associated.
formaction <button>, <input> This HTML attribute specifies the target location of the data to send, upon form submission only for the "submit" type.
formenctype <button>, <input> This HTML attribute sets the encoding type to incorporate while form submission only for the "submit" type.
formmethod <button>, <input> This HTML attribute declares the submission method to use during form submission (GET, POST, etc.) only for the "submit" type.
formnovalidate <button>, <input> This HTML attribute tells the browser not to validate the form upon submission only for the "submit" type.
formtarget <button>, <input> This HTML attribute declares where to display (i.e. new tab, new window, etc) the response after form submission only for the "submit" type.
frame <table> This HTML attribute indicates the browser to display which part of the table.
frameborder <frame>, <iframe> This HTML attribute tells the browser whether to display the border of a frame or not.
framespacing <frame>, <iframe> This HTML attribute sets the spacing between the frames in a frameset.
headers <td>, <th> This HTML attribute defines the relation of a cell to the header cells.
height <table>, <tbody>, <td>, <tfoot>, <th>, <thead>, <th>, <applet> This HTML attribute sets the height of an element.
height <canvas>, <embed>, <iframe>, <img>, <input>, <object>, <video> This HTML attribute declares the height of the element.
hidden Global Attribute This HTML attribute makes an element irrelevant and hides it from the screen.
high <meter> This HTML attribute sets the upper limit of a range.
href <a>, <area>, <base>, <link> This HTML attribute declares the URL of the target link.
hreflang <area> This HTML attribute tells the language of the linked document or resource.
hreflang <a>, <link> This HTML attribute tells the language of the linked document or resource.
hspace <embed>, <iframe>, <img>, <input>, <object> This HTML attribute defines white space or padding on the left or right side of an element.
http-equiv <meta> This HTML attribute declares a pragma directive i.e. an HTTP header for the value of the content attribute.
icon <command> This HTML attribute specifies a picture to represent a command.
id Global Attribute except <base>, <head>, <html> <meta>, <script>, <style>, <title> This HTML attribute sets the ID for an HTML element.
importance <iframe>, <image>, <link>, <script> This HTML attribute indicates the relative fetch priority for the linked resource.
integrity <link>, <script> This HTML attribute specifies a subresource integrity value that enables the browser to verify what they are fetching.
intrinsicsize <img> This HTML attribute ignores the original image size and provides its own defined size for the image.
inputmode <textarea> contenteditable This HTML attribute supplies some hint about the data type while editing an element or its contents.
ismap <img> This HTML attribute enables an image to act as an image map.
itemprop Global Attribute This HTML attribute adds properties to an element.
keytype <keygen> This HTML attribute defines the type of the key value that generates.
kind <track> This HTML attribute tells the kind or type of the text/subtitle track in a video.
label <track>, <option>, <optgroup> This HTML attribute declares the title of the text/subtitle track in a video.
lang Global Attribute except <applet>, <base>, <basefont> <br>, <frame>, <frameset> <iframe>, <param>, <script> This HTML attribute defines the language of the element.
language <input>, <menu> This HTML attribute declares the title of the text/subtitle track in a video.
language <script> This HTML attribute defines the script language.
leftmargin <body> This HTML attribute sets the margin on the left side of the web page.
link <body> This HTML attribute sets the color of the links.
list <input> This HTML attribute points to the id in <datalist> element which has predefined options with values.
loading <img>, <iframe> This HTML attribute declares the loading method of an element i.e. to load "lazily" or "immediately".
longdesc <img>, <frame>, <iframe> This HTML attribute adds the long description file as a link.
loop <audio>, <bgsound>, <maruee>, <video> This HTML attribute will continue to play a video or audio track in a loop.
low <meter> This HTML attribute sets the lower limit of a range.
lowsrc <img> This HTML attribute adds a low-resolution image or an alternative resource image.
manifest <body> This HTML attribute defines the URL of the document's cache manifest.
marginheight <frame>, <iframe> This HTML attribute sets the margin height of a frame in pixels.
marginwidth <frame>, <iframe> This HTML attribute sets the margin width of a frame in pixels.
max <input>, <meter>, <progress> This HTML attribute states the maximum value acceptable.
maxlength <input>, <textarea> This HTML attribute defines the allowable maximum number of characters in an input field.
media <a>, <area>, <link>, <source>, <style> This HTML attribute defines the device for which the liked resource or document is optimized.
method <form> This HTML attribute sets the HTTP method to use upon form submission.
min <input>, <meter> This HTML attribute states the minimum value acceptable.
minlength <input>, <textarea> This HTML attribute defines the allowable minimum number of characters in an input field.
multiple <input>, <select> This HTML attribute enables a user to enter more than one value in an input of the type "email" or "file".
muted <video>, <audio> This HTML attribute mutes the video upon page load.
name <applet>, <a>, <embed>, <img>, <option> This HTML attribute sets the name of an applet element but now it is deprecated.
name <button>, <fieldset>, <form>, <frame>, <iframe>, <input>, <map>, <meta>, <object>, <output>, <param>, <select>, <textarea> This HTML attribute sets the name of the element from the list.
novalidate <form> This HTML attribute does not validate a form upon submission.
nohref <area> This HTML attribute tells the browser that there is no action or link.
noresize <frame> This HTML attribute enables the users to resize the frame element.
noshade <hr> This HTML attribute defines a horizontal rule in a solid color without any shade.
nowrap <td>, <th> This HTML attribute disables the word wrap ability.
object <applet> This HTML attribute specifies a serialized object file for an applet element.
onabort <audio>, <embed>, <img alt="alt-text">, <object>, <video> The script inside the onabort attribute runs or aborts media loading.
onafterprint <body> A script defined by the onafterprint attribute runs after a document prints.
onbeforeprint <body> A script defined by the onbeforeprint attribute runs before a document prints.
onbeforeunload <body> The script defined using the onbeforeunload attribute runs when the document is about to be unloaded
onblur All visible elements. When the element loses focus, the script runs as defined by the onblur HTML attribute.
oncanplay <audio>, <embed>, <object>, <video> If a file is ready to play, the script runs as defined by the oncanplay attribute.
oncanplaythrough <audio>, <video> If a file is ready to play until the end without pausing for buffering, the script runs as defined by the oncanplaythrough attribute.
onchange All visible elements. When the content of the element is changed, the script runs set by the onchange attribute.
onclick All visible elements. When someone clicks the element, the script defined by onclick runs immediately.
oncontextmenu All visible elements. A script contained in the oncontextmenu attribute runs when a context menu is triggered
oncopy All visible elements. If the user copies the content of an element, the script of the oncopy attribute runs.
oncuechange <track> A script in the oncuechange attribute triggers when the cue changes in an <track> element
oncut All visible elements. If the user cuts the content of an element, the script of the oncut attr