Hello,

I have added a simple enhancement to the prototype lib (v1.6.0) which
can be used to get the last childnode of element:

    lastDescendant: function(element) {
        var descs = $(element).descendants();
        var iterator = 1;
        element = descs[descs.length-iterator];
        while(element && element.nodeType != 1 && iterator <= descs.length) {
            iterator++;
            element = descs[descs.length-iterator];
        }
        return $(element);
    }

With syntax highlighting it is available here: http://pastebin.com/f5918ff36

I hope some of you will find it useful. :)

Regards,
Daniel Varga, Hungary

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to