HTML attribute

A name and value written inside a start tag, such as class="card" or hidden, that configures an element.

In more detail

Attributes set things like an element's id, classes, link target or accessibility state. JavaScript reads and changes them with getAttribute and setAttribute, and a MutationObserver can watch them for changes.

Related terms

Taught in

References