SyntaxStudy
Sign Up
Home JavaScript Exercises DOM Manipulation

DOM Manipulation

Beginner

Complete the DOM manipulation code.

To select an element by id: document.("myId")

To select the first element matching a CSS selector: document.(".myClass")

To change the text of an element: el. = "new text"

To add a CSS class: el.classList.("active")

To listen for a click event: el.("click", handler)