Attributes allow developers to alter the behaviour of elements or to provide associated metadata.

Attributes may be expressed with a value:

<div class="my-container">

Or without:

<input readonly>

In XML and XHTML attributes written without a value receive their name as a value. In HTML they receive an empty string.

  1. Global
  2. Shared