title: svg change polygon color onclick
body: <p>I have a SVG map of france in my webpage and every district is a polygon, I need that when I click a district the color change and stay that way until I click it again</p>
  
  <p>this is my code</p>
  
  <pre><code>function init(evt) {
    if ( window.svgDocument == null ) {
        svgDoc = evt.target.ownerDocument;
     }
  
  function update(district){
      $(this).find("path, polygon, circle").attr("fill", "#0d0");&lt;- what is wrong
     }
  </code></pre>
  
  <p>this is one of my polygons </p>
  
  <pre><code>&lt;path id="14" d="M82.387,173.009L109.168,141h2.42l3.33-5.965l20.425,8.818l5.296,0.475l-
   1.876,31.861l5.236,7.5v8.018 l-15.6-1.701l
   0.273-3.599C128.127,186.407,99.635,180.95,82.387,173.009z" fill="#CCCCCC"
  onclick="update('14')"&gt;
  </code></pre>
  
  <p>as you can see Im getting the onclick event the problem is I cant get the polygon to change color.</p>
  
  <p>thanks in advance.</p>