SVG XML


 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  
    var rectNode = null;
    var parent   = null;
    var svgDocument = null;
    function remove(event)
    {
       rectNode = event.target;
       parent   = rectNode.parentNode;
       parent.removeChild(rectNode);
       svgDocument = parent.getOwnerDocument();
       circleNode = svgDocument.createElement("circle");
       circleNode.setAttribute("style","fill:blue");
       circleNode.setAttribute("cx", "100");
       circleNode.setAttribute("cy", "100");
       circleNode.setAttribute("r",  "100");
       parent.appendChild(circleNode);
    }
  
  
     
       Click inside the rectangle:
     
  
  
                x="0" y="0" width="200" height="100"/>