Home »
MCQs »
JavaScript MCQs
Which property is used to define the HTML content to an HTML element with a specific id?
10. Which property is used to define the HTML content to an HTML element with a specific id?
- innerText
- innerContent
- elementText
- innerHTML
Answer: D) innerHTML
Explanation:
The innerHTML is the property that defined HTML content.
Example:
document.getElementById("notif").innerHTML = "New course launched";