In HTML, on the opening tag of an element, we can place attributes.
Attributes provide details about an element or specify how it works.
Here is the basic syntax for an attribute.

The attribute value may be a string or a number depending on the different types of attributes.

Boolean Attributes
A few attributes, including the “checked” attribute (example below), have a slightly different syntax.

In the above example we the code of a preselected checkbox.
We use the checked attribute to pre-select it.

The checked attribute does not require a value.
When the checked attribute is present in the element, the checkbox is checked by default, and if not, it remains unchecked.
We call this a boolean attribute.
In HTML, other frequently used boolean attributes are “disabled” and “required”.
These attributes define the state of an element. And that state can be either True or False, thus we call them boolean.
Wrapping Up
HTML uses numerous attributes to control how elements look and behave on a webpage.
Understanding attributes is key to building interactive, accessible websites.