English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Global attributes: can be used to configure the common behavior of all elements, such attributes are called global attributes, and can be used on any element. Local attributes: some elements can specify their own attributes, such attributes are called local attributes. For example, the link element has the local attributes href, rel, hreflang, media, type, sizes, and these six.
Attribute | Description |
accesskey | Sets the keyboard shortcut to access the element |
class | Specifies the class name (classname) of the element |
contenteditableHTML5 | Specifies whether the content of an element is editable |
contextmenuHTML5 | Specifies the context menu of an element. When the user right-clicks the element, a context menu appears |
data-*HTML5 | Used to store custom data for the page |
dir | Sets the text direction of the content within an element. |
draggableHTML5 | Specifies whether an element can be dragged |
dropzoneHTML5 | Specifies whether to copy, move, link, or delete data |
hiddenHTML5 | The hidden attribute specifies that the element is hidden. |
id | Specifies the unique id of the element |
lang | Sets the language code for the content of the element |
spellcheckHTML5 | Checks if there are spelling errors in the element |
style | Sets the inline style (inline style) for the element |
tabindex | Sets the tabbing order for the element. |
title | Specifies additional information for the element (which can be displayed in a tooltip) |
translateHTML5 | Specifies whether the value of an element needs to be translated when the page is loaded |