title: changing attribute of a span element using javascript where the class changes dynamically
body: <p>heres the problem, our css classnames for a span element keeps changing whenever we generate. so to simplify, we have a span element </p>
  
  <pre><code>&lt;tr&gt;
     &lt;td&gt;
         &lt;span class=1234&gt;My Name is BouncingHippo&lt;/span&gt;
     &lt;/td&gt;
          ....other well-defined DOM elements with id etc...
   &lt;/tr&gt;
  </code></pre>
  
  <p>i have a radio button somewhere on the html, where onchange, it will change the font-color of the span element. </p>
  
  <p>The span element has no id, no name, and a span class that changes all the time. My current method is brute-force <code>getElementsByTagName()</code> to return a specific line using <code>innerHTML</code> for every <code>&lt;tr&gt;</code> and insert the style attribute that way. </p>
  
  <p>Is there a better way for this? Reason why span class changes every generation is for security purposes stipulated by our client..</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>a rough concept on jsfiddle of the brute-force method that i have yet to get it working..
  <a href="http://jsfiddle.net/3jVnJ/1/" rel="nofollow">http://jsfiddle.net/3jVnJ/1/</a></p>