mooTree 2

example 2: adopting a tree from a structure of ul/li elements

This demonstrates adoption of a tree from a structure of ul/li elements in your document.

Note that the properties of the a-tag in each li element are stored in the node's data-object with the same name - for example, data.href contains the href attribute.

The onSelect event of the tree in this example simply displays the url in an alert, but you would probably want to, for example, set the location.href of an iframe, or do some AJAX operation, or something else.

click here to adopt the structure below...