:( Click wont work for newly added items
- $(document).ready(function(){
- $('.item').click(function(){ console.log('clicked') });
- // after some times some '.item's will be added to the dom:
- $('<div class="item"></div>').appendTo($('body'));
- // but the click wont work
- });
how do i write the Click function only one time and make it work for newly added items as well as already existed items ?