working with Jquery dyanmic created elements?
<p>my simple script is append few elements through jquery .<br>
what im trying to do is to add some ajax call for those created elements .<br>
the issue is the event never work for those elements and i tried a lot of Jquery methods but all fail .<br></p>

<pre><code>$("#currentbuild").append('&lt;li class="cancelevent"&gt;&lt;/li&gt;');
$('.cancelevent').bind("click",function(e) {
                        var eventid = $(this).attr('id');
                        e.preventDefault();
                        alert(eventid);
                })
</code></pre>

<p>also i tried </p>

<pre><code>$("#currentbuild").append('&lt;li class="cancelevent"&gt;&lt;/li&gt;');
$('.cancelevent').on("click",function(e) {
                        var eventid = $(this).attr('id');
                        e.preventDefault();
                        alert(eventid);
                })
</code></pre>

<p>but it never show up anything</p>
