Pablo

empty()

Removes all child elements of each element in the collection, and returns the collection.

In this example, click to empty the SVG root:

var svg = Pablo(demoElement).svg({height:100});

svg.on('click', function(){
    svg.empty();
    alert(svg.children().length + ' children');
});

svg.rect({width:100, height:100, fill:'red'});
svg.circle({cx:200, cy:50, r:50, fill:'purple'});
alert(svg.children().length + ' children');

This also removes any data or events associated with the removed child elements.

Painting is just another way of keeping a diary.
Pablo Picasso