An attribute extends an element, 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