Single Choice
Easy
QHow do you add methods to HTMLElement such that the objects that stand in for the HTML tags in the current page may inherit them?
ID: #5010
Javascript Classes MCQ
249 views
Question Info
#5010Q ID
EasyDifficulty
Javascript Classes MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Whether or not classes defined by the host environment (such as web browsers) can be augmented using Object.prototype depends on the implementation. In some cases, it may be possible to add methods to the prototype of a class and have those methods be inherited by objects that represent instances of the class.
For example, in many web browsers, it is possible to add methods to HTMLElement.prototype and have those methods be inherited by the objects that represent HTML tags in the current document.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic