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 Attribute Value Description
1 Accesskey (Accesskey) Label key for the function When used it specifies a shortcut for activating an element e.g. press Windows key + F6
2 class Points to specific CSS Class attributes bind the elements with their CSS
3 contenteditable ‘True’ or ‘False’ This attributes guides whether the element is editable or not
4 contextmenu ID Specific Right-click on the context area to find the custom menu defined for that section
5 data Any information or data Using this attribute one can add information to be used in the application directly
6 dir ‘ltr’ ‘rtl’ ‘auto’ the direction of the text in case of multi-use of languages
7 draggable ‘True’ or ‘False’ This attribute specifies whether an element is draggable or not
8 dropzone ‘Copy’ ‘Move’ ‘Link’ These attributes can allow elements to copy move or link to other elements
9 hidden use to hide It instructs the browser whether that element is not yet or is no longer useful now
10 id created uniquely Specifies the function and characteristics of every unique ID made
11 lang Language tag This attribute corresponds to the language of the element
12 spellcheck ‘True’ ‘False’ Spellcheck simply instructs the browser to whether check the spelling and grammar or not
13 style String This tag is used to add inline CSS for elements that override global CSS as well as any other properties allocated to that element.
14 tabindex Integer value This tabindex attribute specifies the order of the element
15 title Info on particular information This attribute can add more meaningful and extra information to the element
16 translate ‘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.


Also, Check Out

HTML5 Question and Answers


admin

Recent Posts

Modern Toys, Magical Moments: Why the Best Toy Shop in Noida Is More Than Just a Store

When it comes to children, there’s one universal truth: the right toy can spark imagination, build skills, and make memories…

6 months ago

Rediscovering Joy: A New Era of Creativity & Comfort in Toy Stores

In today’s digital age, where screens and gadgets dominate our children’s lives, there’s something heartwarming about a well-loved plush toy…

6 months ago

Unboxing Imagination: Discovering the Joy of Play at a Toy Store in Noida

In a world dominated by screens and fast-paced routines, it’s easy to forget the simple magic of a toy in…

6 months ago

Imagination Unboxed: Discover Joy at the Toy Shop in Delhi

In the heart of Delhi’s vibrant streets lies a world where imagination meets innovation — the magical universe of toys.…

6 months ago

Play with Purpose: Discovering the Ultimate Toy Store in Noida

When was the last time a toy truly amazed you—not just as a product, but as a thoughtful tool for…

6 months ago

From Tears to Toys: Exploring Modern Childhood through Delhi’s Favorite Toy Shop

In the digital age, the way we experience childhood has changed, but the essence remains the same—imagination, exploration, and joy.…

6 months ago