5. What is the difference between an element and a tag?

A tag is the markup syntax such as <p> or </p>. An element is the complete construct, including its opening tag, content, and closing tag when applicable. For example, <p>Hello</p> is a paragraph element.

Key Takeaways
  • Tags are syntax.
  • Elements represent document nodes and their semantics.
Knowledge Check

Which represents the complete HTML element?