title: How to assign a class to an SVG element
body: <p>I'm trying to assign my variable pellet (which is a circle svg) to the class pelClass. For some reason it is not being assigned and is causing a lot of issues. Please help!</p>
  
  <pre><code>function positionPellet() 
  {  
      constantCount = 1;
  
      while(pelletCount &lt; constantCount*3)
      {
      var pellet = document.createElementNS( xmlns, 'circle' );
      pellet.setAttribute( 'cx', Math.random() * window.innerWidth );
      pellet.setAttribute( 'cy', Math.random() * window.innerHeight );
      pellet.setAttribute( 'r' , 10 );
      pellet.className = "pelClass"; //Pellet Class Adding
      pelletCount++;
      pelletList = new Array(pelletCount);
      pelletList.push(pellet);
      svg.appendChild(pellet);
      }
  }
  </code></pre>