Hi Garrett.

Garrett Smith:
> nextSibling and previousSibling are useful, but not always what I want.
> 
> I usually want to get a siblingElement than a sibling, which might be
> a  text node.
> 
>       Dom.findNextSiblingElement = function(el) {
>               for(var ns = el.nextSibling; ns != null; ns = ns.nextSibling)
>                       if(ns.nodeType == 1)
>                               return ns;
>                       return null;
>       };

There is http://www.w3.org/TR/ElementTraversal/, which specifies just
this.

-- 
Cameron McCormack, http://mcc.id.au/
        xmpp:[EMAIL PROTECTED]  ▪  ICQ 26955922  ▪  MSN [EMAIL PROTECTED]

Reply via email to