June 2025
Beginner
817 pages
31h 30m
English
JavaScript is commonly used to read, modify, or extend elements in the DOM. For those types of access to the DOM and its element nodes, the document object provides several methods.
|
Method |
Description |
|---|---|
|
document.getElementById() |
Finds an element based on the id attribute |
|
document.getElementsByTagName() |
Finds all elements with a specific tag name |
|
document.getElementsByClassName() |
Finds all elements of a given CSS class |
|
document.getElementsByName() |
Finds HTML elements with a specific “name” attribute |
|
document.querySelector(s) |
Returns the first element (and only this one) that corresponds to the specified CSS selector s |
|
document.querySelectorAll(s) |
Returns a list with ... |
Read now
Unlock full access