DEV Community

Raj
Raj

Posted on

Html Attribute

What is an HTML Attribute?

An HTML attribute provides additional information about an HTML element. It is always written inside the opening tag.

Example:
Content
Example:

Google
href Attribute name

https://www.google.com → Attribute value

The HTML standard has 100+ attributes, and browsers continue to support additional global, element-specific, and newer attributes as HTML evolves.

they are called common HTML attributes?

  • id
  • class
  • href
  • src
  • alt
  • title
  • style
  • type
  • value
  • placeholder
  • name
  • disabled
  • required
  • checked
  • readonly
  • maxlength
  • pattern

Common HTML Attributes

Types of Attributes

  1. Global Attributes
  • id
  • class
  • style
  • title
  • hidden
  1. Element-Specific Attributes
  1. Boolean Attributes
  • required
  • checked
  • disabled
  • readonly
  • autofocus

Top comments (0)