View video tutorial

HTML Attribute List

HTML

The page lists all HTML attributes and shows what elements the attributes can be used in.

HTML Attribute List

The table below lists all HTML attributes and shows what elements the attributes can be used within.

Attribute_Name Used within Description
accept <input> Specifies what type of file the server accepts (only for type="file").
accept-charset <form> This specifies the character encodings to use for form submissions.
accesskey Global Attributes This specifies a shortcut key to activate or focus an element.
action <form> This specifies where to send form-data when submitting a form.
align Not supported in HTML5. This specifies alignment according to surrounding elements.. Use CSS instead.
alt <area>, <img>, <input> It specifies an alternate text when the element fails to display source.
async <script> It specifies that the script is executed asynchronously (only for external scripts).
autocomplete <form>, <input> This specifies whether the form or input element should be autocomplete enabled.
autofocus <button>, <input>, <select>, <textarea> It specifies whether the element should automatically receive focus when the page loads.
autoplay <audio>, <video> It specifies that the audio/video will start playing as soon as it is ready.
bgcolor Not supported in HTML5. It specifies the background color of an element. Use CSS instead.
border Not supported in HTML5 It specifies the width of the border of an element. Use CSS instead.
charset <meta>, <script> It specifies the character encoding.
checked <input> It specifies that an input element should be pre-selected when the page loads (if type="checkbox" or type="radio").
cite <blockquote>, <del>, <ins>, <q> It specifies a URL to explains the text.
class Global Attributes It specifies one or more classnames for an element to use in a style sheet.
color Not supported in HTML5 It specifies the text color of an element. Use CSS instead.
onabort <audio>, <embed>, <img>, <object>, <video> The script to be run on abort.
onafterprint <body> The script is executed after the document is printed.
onbeforeprint <body> The script is executed before the document is printed.
onbeforeunload <body> The script is executed before the document is unloaded.