title: SVG - getElementsByClassName
body: <pre><code>  &lt;script type="text/ecmascript"&gt;
    &lt;![CDATA[
    function setCoordinates(circle) {
    var centerX = Math.round(Math.random() * 1000);
    var centerY = Math.round(Math.random() * 1000);      
    circle.setAttribute("cx",centerX);
    circle.setAttribute("cy",centerY);
    }
    ]]&gt;
    &lt;/script&gt;
  
  
    &lt;circle class="circles" cx="500" cy="500" r="25" fill="white" filter="url(#f1)" /&gt;
    &lt;circle class="circles" cx="500" cy="500" r="25" fill="white" filter="url(#f1)" /&gt;
    &lt;circle class="circles" cx="500" cy="500" r="25" fill="white" filter="url(#f1)" /&gt;
    &lt;circle class="circles" cx="500" cy="500" r="25" fill="white" filter="url(#f1)" /&gt;
    &lt;circle class="circles" cx="500" cy="500" r="25" fill="white" filter="url(#f1)" /&gt;
  
  
    &lt;script type="text/ecmascript"&gt;
    &lt;![CDATA[
    setCoordinates(document.getElementsByClassName("circles"));
    ]]&gt;
    &lt;/script&gt;
  </code></pre>
  
  <p>This simply has no effect. However, when I used "getElementByID" and assigned an ID to the circle, it worked fine.  (Opera)</p>