Search code examples
javascriptjqueryhtmlprototyping

Extending HTMLElement


using jQuery it is possible to do something like this: $("div")[5].animate()

This seems to me like the developers in a way extended the HTMLElement using prototype.

My question is now: How did they do this? Since HTMLElement.prototype is not working in IE for example I wonder if there is a cross browser method to prototype HTML elements.

Thanks!


Solution

  • You can't extend those things in IE; IE just does not implement the DOM interface that way. That's why Prototype forces you to "wrap" elements that you want to manipulate with those additional methods.