HTML attributes provide additional information about HTML elements. HTML elements are typically represented by tags, and those tags can include one or more attributes. These attributes define an element’s behavior, appearance, and how it functions.
|
contenteditable Making HTML Elements Editable |
The contenteditable attribute specifies whether the content of an element is editable. When set to true, the content becomes editable. When set to false, editing is disabled. |
|---|---|
|
cite Referencing the Source URL |
The cite attribute specifies the source URL of a quote or change, and is used in q, blockquote, ins, and del tags. It helps authors and search engines understand the source of the quoted or modified content. |
|
datetime Specifying the Date and Time |
The datetime attribute specifies a machine-readable date or time for the element. It is used with the del, ins, and time tags. |
|
enterkeyhint Specifying the Enter key for virtual keyboards |
The enterkeyhint attribute explicitly specifies the text or icon label for the Enter key on virtual keyboards, allowing you to define the action label users see. |
|
inputmode Specifying the Virtual Keyboard Input Mode |
The inputmode attribute specifies the virtual keyboard input mode for input fields on devices like mobile phones and tablets. |
|
lang Specifying the Primary Language |
The lang attribute specifies the primary language of an element's content and of any text-containing attributes. |
|
rel Meaning, List, and Examples |
The rel attribute is used to specify the relationship between the current document and the linked resource. |
|
role A Guide to ARIA Roles & Accessibility |
The role attribute in HTML is an extension of the standard element model that adds clearer meaning and structure to HTML elements. |
|
title Advisory Information for the Element |
The title attribute represents advisory information about the element, such as guidance or descriptive notes. |
|
<img> Tag with srcset & sizes Responsive Images with <img> |
A clear and simple guide to using the HTML <img> tag with srcset and sizes attributes for creating responsive images that adjust based on screen width and resolution. |