as I see prototype has not yet got something like a simple clear
Method for DOM elements, though it would be  easy.. to do such a
thing, would'nt it ? If you have already such a thing.. simply prove
me wrong, but since not I would suggest somthing like this
Element.clear(); :

done that with your lovely addMethods functionality to extend the
Element Class, which is pretty nice to add some  extra functionality
with an object oriented $() extended style.


   clear: function(element){
        var elementToClear = $(element);

        if((elementToClear) && (elementToClear.childNodes)){
                for(var i = elementToClear.childNodes.length-1;
elementToClear.childNodes.length > 0 ;i--){
                        var node = elementToClear.childNodes[i];

regards Thomas
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to