Attribute

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

An attribute extends a tag, changing its behavior or providing metadata.

An attribute always has the form name="value" (the attribute's identifier followed by its associated value).

You may see attributes without the equals sign or a value. That is a shorthand for providing the empty string in HTML, or the attribute’s name in XML.

<input required>
<!-- is the same as… -->
<input required="">
<!-- or -->
<input required="required">

Learn more

Technical reference