Appendix B. HTML Global Attributes
B
HTML Global Attributes
The global attributes listed here may be used with any HTML element. For more detailed information, please see:
- The HTML spec (html.spec.whatwg.org/multipage/dom.html#global-attributes)
- The “Global Attributes” overview on MDN Web Docs (developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes)
|
Attribute |
Values |
Description |
|---|---|---|
accesskey
|
single text character |
Assigns an access key (shortcut key command) to the link. Access keys are also used for form fields. Users may access the element by pressing Alt-<key> (PC) or Ctrl-<key> (Mac). Example: accesskey="B". |
autocapitalize
|
none | off | on | sentences | words | characters |
Provides capitalization hints for elements where contenteditable is set to true, and for form and input elements to direct the capitalization of user-provided content (with the exception of the URL, email, and password input states, which never have capitalization enabled). |
autocorrect
|
on | off | "" (empty string) |
Enables automatic correction of spelling and/or punctuation errors for elements where contenteditable is set to true, and for form and input elements (with the exception of the URL, email, and password input states). Experimental as of this writing. |
autofocus
|
Boolean attribute; no values |
Indicates the element should be focused when the page loads. |
class
|
text string |
Assigns one or more classification names to the element. Multiple ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access