JavaScript DOM
DOM methods for interacting with HTML elements. This category documents 494 JavaScript dom entries, and each page gives you the full syntax, the parameter list, the return value, a runnable example, time complexity, the TypeScript signature, and the mistakes developers most often make with that API. The entries are: document.getElementById(), document.querySelector(), document.querySelectorAll(), element.addEventListener(), element.removeEventListener(), document.createElement(), element.appendChild(), element.removeChild(), element.replaceChild(), element.classList.add(), element.classList.remove(), element.classList.toggle(), element.classList.contains(), element.getAttribute(), element.setAttribute(), element.removeAttribute(), element.textContent, element.innerHTML, element.style, element.closest(), element.matches(), element.insertAdjacentHTML(), element.insertBefore(), element.before(), element.after(), element.remove(), element.replaceWith(), element.cloneNode(), element.contains(), element.getBoundingClientRect(), element.scrollIntoView(), element.focus(), element.blur(), element.children, element.parentElement, element.nextElementSibling, element.previousElementSibling, element.firstElementChild, element.lastElementChild, element.insertAdjacentText(), and more. For a structured walkthrough of the whole topic, read the DOM guide. Not sure which method you need? document.getElementById() and document.querySelector() are the most commonly used starting points in this category. You can also search across every category from the search page or browse the complete A–Z index.