- id — must be unique on the page; targeted with #idName
- class — reusable across many elements; targeted with .className
- An element can have multiple classes: class="card featured"
<div id="header" class="card featured">...</div>GoCareerGo Tutorials
Tags, attributes, HTML5 APIs and semantic markup — the web's foundation.
class and id are the two attributes CSS selectors and JavaScript most commonly hook into.
<div id="header" class="card featured">...</div>