A name attribut that can't be updated - javascript
<p>It is a script in javascript that add a <code>&lt;div&gt;&lt;/div&gt;</code> and add an id, a class, html.. I want to add name attribut too and my code doesn't works, but I wonder why..</p>

<p>There <a href="https://developer.mozilla.org/fr/DOM/element" rel="nofollow">https://developer.mozilla.org/fr/DOM/element</a> I have seen that <code>element.name = 'newname';</code> can edit it..</p>

<pre><code>function newgroup() {
    var e = document.getElementsByName('group');
    var nb = e.length + 1
    div = document.createElement("div");
    div.id = 'group'+nb;
    div.className = 'panel_drop';
    div.name = '1';
    div.innerHTML = '&lt;h5&gt;Group '+nb+'&lt;/h5&gt;';
    div.innerHTML += '&lt;div class=\'drop_zone\'&gt;&lt;/div&gt;';
    document.getElementById('groups').appendChild(div);

}
</code></pre>
