- Hi Larry,
Dom is a standalone utility that provides static methods for common Dom
tasks. Same goes for Event.
YAHOO.util.Event.on(someElement, 'click', handleClick);
Element is a wrapper for an HTMLElement that brings Event, Attributes,
and Dom together under a common API.
var myEl = new YAHOO.util.Element(someElement);
The utilities are great for when you just want to handle an event, set a
style, or add a class to an element and be done.
Element is useful when you have more tasks to perform as it allows you
to directly address the utility methods on the element itself. Creating
an Element simply to addClass, addListener, or some other basic task is
Sorry about the confusion. Hope this helps.
> What's the deal with the new Element utility? I see that it has some of
> the same methods as the older DOM utility. Is Element going to replace
> DOM or what? Which am I supposed to use?
> I apologize if this has been covered, but I couldn't find anything. It
> sure would be nice if this was explained in the online documentation.
> Yahoo! Groups Links