Add onclick to a dynamically create li tag
<p>I want to be able to add an onclick handler to a dynamically created div.</p>

<p>Here is how I create the elements:</p>

<pre><code>function add_remove_roll_func(){
    for (var i = 0; i&lt;3; i++){
    li_dice_side_one = createElementWithClass('li',arguments[i]);
    add_remove_roll.appendChild(li_dice_side_one);
    document.getElementById("ul");
  }
    }
 add_remove_roll = createElementWithOutClass('ul');
    dice_toolbar_wrapper_close.appendChild(add_remove_roll);
    document.getElementById("dice-content-wrapper");

    add_remove_roll_func("add","remove","roll");
</code></pre>

<p>I want the add remove and roll events to call different functions.</p>

<p>I tried doing <code>add_remove_roll_func("'add' 'onclick="function'...)</code>
But that did not auto-magically work :).</p>

<p>I could do it with jQuery but I need to do this with native javascript.</p>
