title: Selecting SVG and path elements with JavaScript
body: <p>I would like to select the last path in an SVG and remove it.  I've tried a variety of methods, in pure javascript and in jquery and I don't seem to be able to access the SVG properly or its paths.  </p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;div id="thesvgwrapper"&gt;    
    &lt;svg id="thesvg"...&gt;&lt;path ....&gt;&lt;/path&gt;&lt;path ...&gt;&lt;/svg&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I CAN clear the SVG using:</p>
  
  <pre><code>$('svg#thesvg').empty();
  </code></pre>
  
  <p>I CAN see the SVG's contents using:</p>
  
  <pre><code>var svgwrapper = $('#svgwrapper');
  var svgcontents = $(svgwrapper).html();
  alert(svgcontents);
  </code></pre>
  
  <p>However, I CANNOT similarly select the SVG and see it's path contents...</p>
  
  <p>my goal is something like</p>
  
  <pre><code>$('#thesvg path:last').remove();
  </code></pre>
  
  <p>thanks a million for any help</p>