CodesJava

Easy learning with example program codes

HTML Global Attributes

The attributes common to all HTML elements are called the HTML Global attributes. Both the standard and non-standard elements support these attributes and thus can be used with each element. However, the HTML Global attributes may not have any effect on some elements. All the HTML global attributes are listed below:

ATTRIBUTEVALUEUSES
accesskeycharacterTo specify a shortcut key for an element.
classclassnameTo specify one or multiple class names for an element and is mainly used with the stylesheet.
Contenteditabletrue

false

To define whether the content within an element is editable or not. It was introduced in HTML5.
contextmenumenu_idTo specify the id for the <menu> element to be used as a context menu for an element.
data-*somevalueTo store element-specific private data. It was introduced in HTML5.
dirrtl

ltr

auto

To define the direction of the content inside an element.
draggabletrue

false

auto

To define whether an element is movable or not using Drag and Drop API. It was introduced in HTML5.
dropzonecopy

move

link

To specify the action taken (copied, moved or linked) on the dragged element when it is dropped. It was introduced in HTML5.
hiddenTo hide an element from view. It was introduced in HTML5.
ididTo define a unique id for an element.
langlanguage_codeTo define the primary language for the content of an element.
stylestyleTo apply inline CSS to an element.
spellchecktrue

false

To indicate whether the spelling errors should be checked for in the content or not. It was introduced in HTML5.
tabindexnumberTo define the tabbing order of an element.
titletextTo provide additional information about an element.
translateyes

no

To define whether an element’s contents should be translated or not. It was introduced in HTML5.

 

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status