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