replace class name with javascript
<p>I need help finding an element with a specific class name and then replace it with a new class name. Here is the code I came up with. I get no results. The class name does not change, and there are no errors in the console.</p>

<p><strong>Updated Code</strong>:</p>

<pre><code>var classMatches = document.querySelectorAll(".crux.attachFlash");
for (var i = 0; i &lt; classMatches.length; i++) {
    classMatches[i].className = " ";
}
</code></pre>
