change the class of a div
<p>hi guys i have a certain html code from which im taking certain parts using JavaScript
and move them to anther place in my code before i move them in each part there is a div with 
a class name which i want to change but for some reason it wont work?</p>

<pre><code>&lt;script&gt;

window.onload = function () {
    var list = document.getElementById("MenuBar1");
    var items = list.getElementsByTagName("ul");

    for (var i = 0, size = items.length; i &lt; size; i++) {
        items[i].innerHTML.getElementsByTagName('div').className = " headerbar";
        document.getElementById("lior").innerHTML += items[i].parentNode.innerHTML;
    }



}&lt;/script&gt;
</code></pre>
