HTML

HTML Intro

HTML Intro Quiz

HTML Intro Exercise

HTML Basics

HTML Basic Quiz

HTML Basic Exercise

HTML Advance

HTML Advance Quiz

HTML Advance Exercise

HTML Tags List

HTML Global Attributes

HTML Attributes

FAQs

HTML Attributes

List of HTML Attributes

HTML list Attribute
The list attribute is used to refer to a datalist element that contains pre-defined options for an input element.
HTML loop Attribute
The loop attribute is a boolean attribute. It specifies that the media will start over again, every time it is finished.
HTML low Attribute
The low attribute is used to define the range where the gauge value is considered to be a low value.
HTML max Attribute
The max attribute is used to specify the maximum value of the element.
HTML maxlength Attribute
The maxlength attribute is used to define the maximum number of characters allowed in the element.
HTML media Attribute
The media attribute is used to specify what media/device the linked document is optimized for.
HTML method Attribute
The method attribute specifies how to send form data.
HTML min Attribute
The min attribute is used to specify the minimum value of an element.
HTML multiple Attribute
The multiple attributes is a boolean attribute. It allows entering/selecting multiple values when present on any attribute.
HTML muted Attribute
The muted attribute is a boolean attribute. When present, it defines that the audio output of the video should be muted.
HTML name Attribute
The name attribute specifies a name for an HTML element.
HTML novalidate Attribute
The novalidate attribute is a boolean attribute. It specifies that the form data should not be validated when submitted.
HTML onabort Attribute
The onabort attribute is used to specify a script to be run if the loading of the media file aborts.
HTML onafterprint Attribute
The onafterprint attribute fires when a page has started printing, or if the print dialogue box has been closed.
HTML onbeforeprint Attribute
The onbeforeprint attribute fires when a page is about to be printed. It is used in combination with the onafterprint attribute.
HTML onbeforeunload Attribute
The onbeforeunload event fires when the document is about to be unloaded.
HTML onblur Attribute
The onblur attribute fires the moment that the element loses focus. Onblur is most often used with form validation code.
HTML oncanplay Attribute
The oncanplay attribute defines a script to run when the browser can start playing the specified media
HTML onchange Attribute
The onchange attribute fires the moment when the value of the element is changed.
HTML oncanplaythrough Attribute
The oncanplaythrough event occurs when the browser estimates that it can play through the specified audio/video without having to stop for buffering.
HTML onclick Attribute
The onclick attribute fires on a mouse click on the element.
HTML oncontextmenu Attribute
The oncontextmenu attribute fires when the user right-clicks on an element to open the context menu.
HTML oncopy Attribute
The oncopy attribute fires when the user copies the content of an element. It is mostly used with input element.
HTML oncuechange Attribute
The oncuechange attribute is used to define a script to run when the cue changes in a track element.
HTML oncut Attribute
The oncut attribute fires when the user cuts the content of an element. It is mostly used with the input element.
HTML ondblclick Attribute
The ondblclick attribute fires on a mouse double-click on the element.
HTML ondrag Attribute
The ondrag attribute fires when an element or text selection is being dragged. Links are draggable by default similar to images.
HTML ondragend Attribute
The ondragend attribute fires when the user has finished dragging an element or text selection.
HTML ondragenter Attribute
The ondragenter attribute fires when a draggable element or text selection enters a valid drop target.
HTML ondragleave Attribute
The ondragleave attribute fires when a draggable element or text selection leaves a valid drop target.
HTML ondragover Attribute
The ondragover attribute fires when a draggable element or text selection is being dragged over a valid drop target.
HTML ondragstart Attribute
The ondragstart attribute fires when the user starts to drag an element or text selection.
HTML ondrop Attribute
The ondrop attribute fires when a draggable element or text selection is dropped on a valid drop target.
HTML ondurationchange Attribute
The durationchange event occurs when the duration data of the specified audio/video is changed.
HTML onemptied Attribute
The onempties ​​​​​​​fired when the current playlist is empty.
HTML onended Attribute
The onended event occurs when the audio/video has reached the end. It allows us to send useful messages to the users.
HTML onerror Attribute
The error event occurs when an error occurred during the loading of a media file.
HTML onfocus Attribute
The onfocus attribute fires the moment that the element gets focus. It is mostly used on input and select elements.
HTML onhashchange Attribute
The onhashchange attribute fires when there has been changes to the anchor part of current URL.
HTML oninput Attribute
The oninput attribute fires when an element gets user input. The oninput event fires when the value of an input or textarea element is changed.
HTML oninvalid Attribute
The oninvalid event occurs when a submittable input element is invalid
HTML onkeydown Attribute
The onkeydown attribute fires when the user is pressing a key.
HTML onkeypress Attribute
The onkeypress attribute fires when the user presses a key.
HTML onkeyup Attribute
The onkeyup attribute fires when the user releases a key.
HTML onload Attribute
The onload attribute fires when an object has been loaded.
HTML onloadeddata Attribute
The loadeddata event occurs when data for the current frame is loaded, but not enough data to play the next frame of the specified media i.e., audio or video.
HTML onloadedmetadata Attribute
The loadedmetadata event occurs when metadata for the specified audio or video has been loaded. The metadata consists of duration and text tracks.
HTML onloadstart Attribute
The onloadstart event occurs when the browser starts looking at audio or video. This is when the loading process starts.
HTML onmousedown Attribute
The onmousedown attribute fires when a mouse button is pressed down on the element.
HTML onmousemove Attribute
The onmousemove attribute fires when the pointer is moving while it is over an element.
HTML onmouseout Attribute
The onmouseout attribute fires when the mouse pointer moves out of an element.
HTML onmouseover Attribute
The onmouseover attribute fires when the mouse pointer moves over an element. It is mostly used with onmouseout event.
HTML onmouseup Attribute
The onmouseup attribute fires when a mouse button is released over the element.
HTML onoffline Attribute
The onoffline attribute fires when the browser starts to work offline. It is similar to but opposite of ononline attribute.
HTML ononline Attribute
The ononline attribute fires when the browser starts to work online.
HTML onpageshow Attribute
The onpageshow event occurs when a user navigates to a webpage.
HTML onpaste Attribute
The onpaste attribute fires when the user pastes some content in an element. It is widely used with input type text.
HTML onpause Attribute
The onpause attribute is used to define a script to be run when the audio or video is paused either programmatically or by the user.
HTML onplay Attribute
The onplay attribute defines a script to be run when the audio or video is just started or is no longer paused.
HTML onplaying Attribute
The onplaying attributes are used to define a script to run when the audio or video has started playing.
HTML onprogress Attribute
The onprogress attribute is used to define a script that is to be run when the browser is downloading the specified audio or video.
HTML autoplay attribute
HTML autoplay attribute is a boolean attribute that tells the browser whether to start audio or video when it is ready for play.
HTML onratechange Attribute
The onratechange attribute defines a script to be run when the playing speed of the audio or video is changed.
HTML formaction Attribute
HTML formaction attribute is used to decide where to send form-data once a form is submitted.
HTML onreset Attribute
The onreset attribute fires when a form is reset. It is only applied to form element.
HTML onresize Attribute
The onresize attribute fires when the browser window is resized. It is used only on the body element.
HTML onscroll Attribute
The onscroll attribute fires when an element scrollbar is being scrolled. It can be applied to all HTML Elements.
HTML onsearch Attribute
The onsearch attribute fires when a user presses the ENTER key or clicks the x button in an input element with type search.
HTML onseeked Attribute
The onseeked attribute is used to define a script to run when the user is finished moving or skipping to a new position in the audio or video.
HTML onseeking Attribute
The onseeking attribute defines a script to run when the user starts moving or skipping to a new position in the audio or video.
HTML onselect Attribute
The onselect attribute fires after some text has been selected in an element.
HTML onstalled Attribute
The onstalled attribute is used to define a script to run when the browser is trying to get media data but it is not available.
HTML onsubmit Attribute
The onsubmit attribute fires when a form is submitted. It only works with the form element.
HTML onsuspend Attribute
The onsuspend attribute is used to define a script to run when the browser is intentionally not getting media data.
HTML ontimeupdate Attribute
The ontimeupdate attribute is used to define a script to run when the playing position of an audio or video has changed.
HTML ontoggle Attribute
The ontoggle attribute fires when the user opens or closes a details element. The details element actually specifies additional details for the user so that she/he can view or hide that information.
HTML onunload Attribute
The onunload attribute fires once a page has unloaded. In other words, the browser window is closed.
HTML onvolumechange Attribute
The onvolumechange attribute is used to define a script to run each time the volume of a video or audio is changed.
HTML onwaiting Attribute
The onwaiting attribute is used to define a script to run when the video stops because it needs to buffer the next frame
HTML onwheel Attribute
The onwheel attribute fires when the wheel of a pointing device is rolled up or down over an element.
HTML open Attribute
The open attribute is a boolean attribute. It specifies that the details element should be open by default when present.
HTML optimum Attribute
The optimum attribute is used to specify the range where the gauge value is considered to be an optimal value.
HTML pattern Attribute
The pattern attribute specifies a regular expression that the input element value is checked against.
HTML placeholder Attribute
The placeholder attribute is used to specify a short hint that describes the expected value for the given input field or textarea.
HTML poster Attribute
The poster attribute is used to specify an image to be shown while the video is downloading, or until the user hits the play button.
HTML preload Attribute
The preload attribute is used to specify if and how the author thinks that the media file should be loaded when the page loads.
HTML readonly Attribute
The readonly attribute is a boolean attribute. It specifies that an input field or textarea is read-only when readonly attribute is present.
HTML rel Attribute
The rel attribute is used to specify the relationship between the current document and the linked document.
HTML required Attribute
The required attribute is a boolean attribute. It specifies that the element must be filled out before submitting the form when required attribute is present.
HTML reversed Attribute
The reversed attribute is a boolean attribute. It specifies that the list order should be descending instead of ascending when reversed attribute is present.
HTML rows Attribute
The rows attribute specifies the visible height of a text area, in lines. We can also specify it with the CSS properties.
HTML rowspan Attribute
The rowspan attribute specifies the number of rows a cell should span.
HTML sandbox Attribute
The sandbox attribute enables an extra set of restrictions for the content in an iframe.
HTML scope Attribute
The scope attribute is used to specify whether a header cell is a header for a column, row, or group of columns or rows.
HTML selected Attribute
The selected attribute is a boolean attribute. It specifies that an option should be pre-selected when the page loads when the selected attribute is present.
HTML shape Attribute
The shape attribute specifies the shape of an area element. When used together with the coords attribute to specify the size, shape, and placement of an area element.
HTML size Attribute
The size attribute is used to specify the visible width, in characters, for input element and the number of visible options in the drop-down list.
HTML sizes Attribute
The sizes attribute is used to specify the sizes of icons for visual media. It is only used with rel=icon. It works only in link element.
HTML span Attribute
The span attribute is used to define the number of columns a col element or colgroup element should span.
HTML src Attribute
The src attribute is used to specify the location (URL) of the external resource.
HTML srcdoc Attribute
The srcdoc attribute is used to specify the HTML content of the page to show in the inline frame.
HTML srclang Attribute
The srclang attribute defines the language of the track text data. This attribute is required if kind attribute is set to subtitles.
HTML srcset Attribute
The srcset attribute is used to specify the URL of the image to use in different situations like the screen width changes.
HTML start Attribute
The start attribute specifies the start value of the first list item in an ordered list.
HTML step Attribute
The step attribute is used to specify the legal number intervals for an input element.
HTML style Attribute
The style attribute is used to specify an inline style for an element. The style attribute will override any style set globally or in an external style sheet.
HTML target Attribute
The tabindex attribute is used to specify the tab order of an element.
HTML type Attribute
For input elements, the type attribute is used to specify the type of input element to display.
HTML usemap Attribute
The usemap attribute is used to specify an image as an image map i.e, has clickable areas.
HTML value Attribute
The value attribute is used to specify the initial value For button, input, and option elements.
HTML width Attribute
The width attribute is used to specify the width of the element in pixels.
HTML wrap Attribute
The wrap attribute is used to specify how the text in a textarea element is wrapped when submitted in a form.
HTML accept Attribute
The accept attribute specifies the types of files that the server accepts
HTML accept-charset Attribute
The accept-charset attribute is used to specify the character encodings that are to be used for the form submission.
HTML action Attribute
The action attribute specifies where to send the form data when a form is submitted.
HTML alt Attribute
The alt attribute is used to provide the alternative information for an image, area, input tags if a user for some reason cannot view it 
HTML async Attribute
The async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously as soon as it is available.
HTML autocomplete Attribute
The autocomplete attribute is used to specify whether a form or an input field should have to autocomplete on or off. It allows the browser to predict value.
HTML autofocus Attribute
The autofocus attribute is a Boolean attribute. When present, it specifies that the element should automatically get focused when the page loads.
HTML charset Attribute
The charset attribute specifies the character encoding for the HTML document and external javascript file.
HTML checked Attribute
The checked attribute is a boolean attribute.It specifies that an input element should be pre-selected on page load when present in that input. 
HTML cite Attribute
The cite attribute defines a URL in a document that explains the quote, or why the text was put in the first place.
HTML cols Attribute
The cols attribute specifies the visible width of a text area.
HTML colspan Attribute
The colspan attribute is used to specify the number of columns a table cell should span.
HTML content Attribute
The content attribute gives the value associated with the http-equiv or name attribute.
HTML controls Attribute
The controls attribute is a boolean attribute.When present, it specifies that audio/video controls should be displayed.
HTML coords Attribute
The coords attribute specifies the coordinates of an area in an image map.
HTML data Attribute
The data attribute specifies the URL of the resource to be used by the object.
HTML datetime Attribute
The datetime attribute is used to define the date and time when the text was deleted/inserted.
HTML default Attribute
The default attribute is a boolean attribute. When present, it specifies that the track is to be enabled if the user does not choose another track over it.
HTML defer Attribute
The defer attribute is a boolean attribute. When present, it specifies that the script is executed when the page has finished parsing.
HTML dirname Attribute
The dirname attribute allows the submission of the text direction of the input field or textarea.
HTML disabled Attribute
The disabled attribute is a boolean attribute. When present, it specifies that the element is disabled and we cannot use it.
HTML download Attribute
The download attribute specifies that the target will be downloaded when a user clicks on the hyperlink.
HTML enctype Attribute
The enctype attribute specifies how the form data should be encoded when submitting it to the server.
HTML for Attribute
for is used with label element and output element.
HTML form Attribute
The form attribute is used to specify the form the element belongs to. Its value must be equal to the id attribute of a form element in the same document.
HTML headers Attribute
The headers attribute specifies one or more header cells to a table cell.
HTML height Attribute
The height attribute is used to define the height of the element, in pixels.
HTML high Attribute
The high attribute is used to define the range where the gauge value is considered to be a high value.
HTML href Attribute
The href attribute specifies different properties for different tags. It is used in the following elements:- a, area, base, and link tags
HTML hreflang Attribute
The hreflang attribute is used to specify the language of the linked document.
HTML http-equiv Attribute
The http-equiv attribute provides an HTTP header for the information/value of the content attribute.
HTML ismap Attribute
The ismap attribute is a boolean attribute. When present, it specifies that the image is part of a server-side image map that has clickable areas.
HTML kind Attribute
The kind attribute is used to specify the kind of text track.
HTML label Attribute
The label attribute is used to define the title of the text track. It is used by the browser when listing all available text tracks of the current video.