September 2024
Beginner to intermediate
985 pages
35h 37m
English
Whether you want to change existing information on a web page or add new information, you must first select an element on the web page that you want to change or to which you want to attach the new information. For this purpose, the DOM API offers various properties and methods, as shown in Table 5.2.
As you can see, there are some methods that return multiple elements and other methods that return single elements. We'll look at the details in the following sections.
|
Property/Method |
Description |
Return Code |
Section |
|---|---|---|---|
|
getElementById() |
Selects an element based on an ID |
Single element |
|
|
getElementsBy-ClassName() |
Selects elements based on a class name |
List of elements |
Read now
Unlock full access