Setting the name attribute dynamically
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2565909/getelementbyclass-setattribute-doesnt-work">getElementByClass().setAttribute doesn&#39;t work</a>  </p>
</blockquote>



<p>Why this:</p>

<pre><code>document.getElementsByClassName('cke_source').setAttribute('name', "mymessage") 
</code></pre>

<p>Is returning:</p>

<pre><code>TypeError: Object #&lt;NodeList&gt; has no method 'setAttribute'
</code></pre>

<p><code>document.getElementsByClassName('cke_source')</code> is returning the object correctly.</p>

<ul>
<li>No jQuery please.</li>
</ul>
