Mid JavaScript

What are HTML tags and attributes?

  • Tags define the structure and content (e.g., <p>, <h1>, <div>).
  • Attributes provide additional details about an element (e.g., src, href, alt).

Follow me on LinkedIn:

Example:

<img src="logo.png" alt="Company Logo">

Here, <img> is a tag, and src & alt are attributes.

Key Takeaway:

Tags = structure; Attributes = extra information.

More from JavaScript Tutorial

All questions for this course