Updated title to better reflect what I\'m trying to do.
In short, there are different constructors for different dom elements, and they don\'t seem to all share a co
I think what you want can be achieved by prototyping the Element interface, like
Element.prototype.getElementsByClassName = function() {
/* do some magic stuff */
};
but don't do this. It doesn't work reliably in all major browsers.
What you're doing in the example in your question is not advisable, too. You're actually extending host objects. Again, please don't do this.
You'll fall in exactly those pitfalls Prototype ran into.
I don't want to merely copy Kangax' article, so please read What’s wrong with extending the DOM.
Why do you want this in the first place? What's your goal?