getElementById, querySelector, and more
The getElementById() method finds an element by its unique ID attribute. It's one of the most common ways to select elements!
// HTML:
<h1 id="title">Welcome!</h1>
// JavaScript:
let titleElement = document.getElementById("title");
console.log(titleElement); // <h1 id="title">Welcome!</h1>Important: IDs must be unique on a page. Each element can have only one ID, and each ID can only be used once!