O'Reilly logo

YUI 2.8 Learning the Library by Dan Wellman, Daniel Barreiro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DOM manipulation in YUI

The YUI Dom utility enhances your DOM toolkit in several important ways, giving you more power and more control. First of all, it adds a whole range of new methods for obtaining DOM nodes such as:

  • .getAncestorByTagName()
  • .getAncestorByClassName()
  • .getChildren()
  • .getElementsByClassName()

These give you much more flexibility than the standard DOM node retrieval methods. As if these additions weren't enough in themselves, the YUI Dom utility also gives you a range of methods for defining your own parameters with which to obtain elements. These include:

  • .getAncestorBy()
  • .getChildrenBy()
  • .getElementsBy()
  • .getFirstChildBy()
  • .getLastChildBy()
  • .getNextSiblingBy()
  • .getPreviousSiblingBy()

In some of these methods that would return an array ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required