Skip to content Skip to sidebar Skip to footer

Overwrite The HTMLNode Interface

I would like to hook into the Node constructor function. Is it possible to overwrite the public Node constructor with my own Node constructor? Currently only testing in chrome/fire

Solution 1:

Nope. You cannot redefine constructor either for DOM Node or for any other DOM object (you can however do that for JavaScript objects).

Also, it is absolutely useless to try and redefine DOM objects constructors, since they generally cannot be invoked directly (except for Image and a couple of others), thus the issue of arguments is irrelevant. Tracking the DOM changes can be done using Mutation Events.


Post a Comment for "Overwrite The HTMLNode Interface"