#javascript-code-15-nodename.js / js
// Find all the parents of this node, that are an <li> element var cur = this.parentNode; while ( cur != null ) { // Once the element is found, and the name verified, add a class if ( cur.nodeName == ‘LI’ ) cur.className += “ current”; cur = this.parentNode; }
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.