Which property is used to change the text content of a selected element?
- innerText
- textContent
- innerHTML
- text
The textContent property is used to change the text content of a selected element. It sets or returns the text content of an element and ensures that any HTML tags are treated as plain text. The other options do not handle text content in the same way.
Loading...
Related Quiz
- A _______ function is a function that accepts up to three arguments: the value of the element, the index of the element, and the array object being traversed.
- In a performance-critical application, minimizing the reshuffling of array elements is vital. What method might be avoided when removing elements due to its time complexity?
- The for...in loop will also iterate over the _______ properties of an object.
- What is the main difference between function declaration and function expression in JavaScript?
- The switch statement evaluates expressions based on their _________.