YUI 3.x Home -

YUI Library Examples: Node: DOM Methods

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

Node: DOM Methods

This example demonstrates how to use the DOM methods of a Node instance.

Click any of the boxes to remove them.

  • lorem
  • ispum
  • dolor
  • sit

Setting up the Node

First we need some HTML to work with.

Using DOM Methods

Most common DOM methods are available via Node instances. These can be used to add, remove, and retrieve other nodes.

Now we need a handler to remove a node when the click event fires.

Listening for Node Events

We can assign our handler to all of the items by using the all method to get a NodeList instance and using the on method to subscribe to the event.

Full Script Source

Copyright © 2008 Yahoo! Inc. All rights reserved.

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