Examveda
Examveda

What is the procedure to add methods to HTMLElement so that they will be inherited by the objects that represent the HTML tags in the current document?

A. HTMLElement.prototype(…)

B. HTMLElement.prototype

C. HTML.addmethods()

D. HTML.elements(add)

Answer: Option B

Solution(By Examveda Team)

It is implementation-dependent whether classes defined by the host environment (such as the web browser) can be augmented using Object.prototype. In many web browsers, for example, you can add methods to HTMLElement.prototype and those methods will be inherited by the objects that represent the HTML tags in the current document.

This Question Belongs to Javascript >> Classes And Modules

Join The Discussion

Related Questions on Classes and Modules