Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
HTML5 Fundamentals & Document Anatomy 15 mins read Free Lesson

HTML Attributes & Global Identifiers

Master element attributes, including id, class, title, data-* attributes, and boolean flags.

HTML Attributes

Attributes provide additional configuration details about HTML elements. They are always specified in the opening tag as name="value" pairs.

Essential Global Attributes:

  • id: Specifies a unique identifier across the entire DOM document.
  • class: Assigns one or more CSS class names (space-separated).
  • title: Provides advisory tooltip information when hovering over an element.
  • data-*: Custom data attributes for JavaScript state management.
  • hidden: A boolean attribute indicating that the element is not currently visible.
<article id="post-101" class="blog-card featured" data-category="backend">
    <h2>Architecting High-Performance APIs</h2>
</article>