Event listener in a loop
<p>So I have this eventListner that calls an Class, works like a charm but only once since inte call the add class with index 0.</p>

<p>Im trying to create a loop that will call every add class inside the script, but i cant get loop...</p>

<p>This is the event listner without the loop</p>

<pre><code>var AddEvent = "add";
var addClass = document.getElementsByClassName(AddEvent)[0]
addClass.addEventListener("click", addDiceEvent, false);
function addDiceEvent() {
      dicesides_funcfunc();
} 
</code></pre>

<p>And this is what Im trying to create.</p>

<pre><code>function AddDice(){
        for (i = 0; i &lt; 5; i++) {
            var addClass =  document.getElementsByClassName("add");
            addClass.addEventListener("click", addDiceEvent, false);
            function addDiceEvent(){
            dicesides_funcfunc();
            }
        }

}  AddDice();
</code></pre>

<p>Any ideas ?</p>
