Single Choice Easy

QWhat is the textContent property?

ID: #5185 Javascript DOM & Event Handling MCQ 147 views
Question Info
#5185Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Sets the textual content of a node
  • B Returns the textual content of a node
  • C Sets & Returns the textual content of a node
  • D Modifies texual content
Correct Answer

Explanation

A node's and its descendants' textual content can be set or returned using the textContent attribute.
Any child nodes are removed and replaced by a single Text node holding the supplied string when the textContent attribute is set.

Share This Question

Challenge a friend or share with your study group.