Refresh document.element after an add with javascript
<p>I have a javascript script that add elements in my page when I click on a button. I want to use these new elements, call them.</p>

<pre><code>var e = document.getElementsByName('group');
</code></pre>

<p>When I execute that before and after the addition of an element with name 'group' (checked in source code), I have the same number of elements..</p>

<pre><code>e.length /* before : return 2 */
e.length /* after... 2 :/ */
</code></pre>

<p>I think document. is not updated, is it true, have you got any solution ? </p>

<p><strong>EDIT :</strong></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.setAttribute('name', 'group');
        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>

<p>I use attribut <code>name</code> to count the number of groups, I select them with their id after. But number is not updated ^^</p>

<p><strong>EDIT 2 :</strong></p>

<p>It was a mistake, I had problems with breakpoints with Chrome development tools.</p>
