September 2024
Beginner to intermediate
985 pages
35h 37m
English
Once you’ve selected one or more elements, you can modify them: you can add or remove text, add or remove attributes, and add or remove elements. Table 5.5 shows an overview of the main properties and methods available for this purpose, which we’ll discuss in detail in the following sections.
As mentioned before, any text on a web page is represented as text nodes within the DOM tree. Now let's take a look at how you can access and also modify the text contents.
|
Property/Method |
Description |
Section |
|---|---|---|
|
textContent |
This property allows you to access the text content of a node. |
|
|
nodeValue |
This property allows you to access the contents of a node. |
|
|
innerHTML |
This ... |
Read now
Unlock full access