Know All About Global Attributes in HTML

HTML Global Attributes are those attributes that can be used anywhere in HTML tags. These attributes give meaning to HTML which defines attributes property as well. Though with some elements they have no effect at all. Few of these Attributes were added in HTML5 and marked.

List of HTML5 Global Attributes and their definition

No.Name of the AttributeValueDescription
1Accesskey (Accesskey)Label key for the functionWhen used it specifies a shortcut for activating an element e.g. press Windows key + F6
2classPoints to specific CSSClass attributes bind the elements with their CSS
3contenteditable‘True’ or ‘False’This attributes guides whether the element is editable or not
4contextmenuID SpecificRight-click on the context area to find the custom menu defined for that section
5dataAny information or dataUsing this attribute one can add information to be used in the application directly
6dir‘ltr’ ‘rtl’ ‘auto’the direction of the text in case of multi-use of languages
7draggable‘True’ or ‘False’This attribute specifies whether an element is draggable or not
8dropzone‘Copy’ ‘Move’ ‘Link’These attributes can allow elements to copy move or link to other elements
9hiddenuse to hideIt instructs the browser whether that element is not yet or is no longer useful now
10idcreated uniquelySpecifies the function and characteristics of every unique ID made
11langLanguage tagThis attribute corresponds to the language of the element
12spellcheck‘True’ ‘False’Spellcheck simply instructs the browser to whether check the spelling and grammar or not
13styleStringThis tag is used to add inline CSS for elements that override global CSS as well as any other properties allocated to that element.
14tabindexInteger valueThis tabindex attribute specifies the order of the element
15titleInfo on particular informationThis attribute can add more meaningful and extra information to the element
16translate‘Yes’ ‘No’This HTML attribute specifies whether the content of an element should be translated while browsing a different language or not

Original Official Source

These HTML global attributes can be used with all HTML elements with avoiding a few areas where they are not relevant like elements within head sections like inside title, script tag, etc.

Global Attributes are applicable to HTML all elements even if they are provided in the current HTML standards. So even the document is no longer HTML5 Compliant these attributes if applied still must work with all HTML elements. Like as foo hidden, custom tags, etc.

In addition to these standard HTML5 Global attributes, there are also a few other attributes that are used

  • xml:lang and xml:base from XHTML specification but are still used often for compatibility purposes.
  • multiple aria-* attributes used for making the web accessible to disable friendly environment.(Accessible Rich Internet Applications i.e. ARIA)
  • HTML Event Attributes i.e.
      • Window Event Attributes : onafterprint, onbeforeprint, onbeforeunload, onerror, onhashchange, onload, onmessage, onoffline, ononline, onpagehide, onpageshow, onpopstate, onresize, onstorage, onunload
      • Form Event Attribute: onblur, onchange, oncontextmenu, onfocus, oninput, oninvalid, onreset, onsearch, onselect, onsubmit
      • Keyboard Events Attribute: onkeydown, onkeypress, onkeyup
      • Mouse Events Attribute: onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onwheel
      • Drag Events Attribute: ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, onscroll
      • Clipboard Events Attribute:onpaste, oncut, oncopy
      • Media Events Attribute: onabort, oncanplay , oncanplaythrough, oncuechange, ondurationchange, onemptied, onended, onerror, onloadeddata, onloadedmetadata, onloadstart, onpause, onplay, onplaying, onprogress, onratechange, onseeked, onseeking, onstalled, onsuspend, ontimeupdate, onvolumechange, ontimeupdate, onwaiting
      • Misc Events Attribute: ontoggle

    You can study them later one by one for a better understanding!

Get Complete info on HTML Global Attributes PDF and download at study at your own will.
HTML global attributes at tutorialmines

Also, Check Out

HTML5 Question and Answers

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *