[thelist] Extending Javascript Objects

Jeffery To jeffery.to at gmail.com
Sat Aug 20 00:48:44 CDT 2005

On 8/19/05, Martyn Haigh <martynh at gmail.com> wrote:
> there are two problems:
> 2, it doesn't work in IE6

If I remember correctly, that's because DOM elements in IE exist
outside of the normal JavaScript object hierarchy, i.e. DOM elements
don't have the Object object in their prototype chains.

> Can anyone think of a better way of doing this which will still be as
> easy as objElement.addClass("alert"); ?

How about addClass(objElement, "alert"); (having addClass be a global function)?


Jeffery To

More information about the thelist mailing list