YUI 3.x Home -

YUI Library Examples: Node: NodeList

Note: This is YUI 3.x. Looking for YUI 2.x?

Node: NodeList

This example demonstrates how to use a NodeList instance to work with multiple nodes.

  • lorem
  • ispum
  • dolor
  • sit

Setting up the Node

First we need some HTML to work with.

Geting a NodeList Instance

We will use the all method of our YUI instance to get a NodeList instance to work with.

Accessing NodeList Properties

As with Node, simple type of properties (strings, numbers, booleans) pass directly to/from the underlying HTMLElement, however properties representing HTMLElements return Node instances.

In this example, we will listen for a click event to trigger the property change.

Full Script Source

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings