HTML Global Attributes

HTML global attributes are those attributes which are common for all HTML elements. The global attributes are supported by both standard and non-standard element.

The global attributes can be used with all elements, although it may not have any effect on some elements.

Following is the complete list of global attributes with their description:

HereHTML Tags Listrepresent new in HTML5.

AttributesvalueDescription
accesskeycharacterIt generates keyboard shortcuts for the currently selected element.
classclassnameIt’s used to provide the current element’s class name. It’s mostly used in conjunction with the stylesheet.
ContenteditableHTML Tags Listtrue
false
It determines whether the content within an element is editable or not.
contextmenumenu_idIt provides the id of the <menu> element, which is used to create a context menu (a menu that appears when you right-click on an element).
data-*HTML Tags ListsomevalueIt is used to store element-specific private data which can be accessed by Javascript.
dirrtl
ltr
auto
It specifies the direction of the content inside the current element.
draggableHTML Tags Listtrue
false
auto
It specifies whether the content within an element is movable or not using Drag and Drop API.
dropzoneHTML Tags Listcopy
move
link
It describes how the dragged element is handled after it is dropped, such as whether it is copied, moved, or linked.
hiddenHTML Tags ListIt is used to hide the element from view.
ididIt specifies a unique id for the element. It can be used with CSS and JavaScript.
langlanguage_codeIt specifies the primary language for the content of an element.
stylestyleIt is used to apply inline CSS to the current element.
spellcheckHTML Tags Listtrue
false
It defines whether or not the material should be proofread for spelling mistakes.
tabindexnumberIt determines the tabbing order of an element.
titletextIt is used to provide the title, name, or some extra information about the element.
translateHTML Tags Listyes
no
It indicates whether or not the element’s content should be translated when the page is localized.

Leave a Comment

Your email address will not be published.