i have following code to show div on page
<div id="all_users">
<div id=user11 userid=11 class=innertxt><img src=images/images.jpg width=50 height=50>
<strong>User11</strong>
<ul> <li>Email: [email protected]</li>
<li> <input type=checkbox id=select11 value=11 class=selectit /></li>
</ul> </div>
<div class="float_break"></div>
</div>
following code work fine and print "test in log window"
$('#all_users .selectit').click(function() {
console.log("test");
});
but when i add div from following code, it didn't show "test in log windows" mean this click event is not activated
var new_data_var = $('<div class="innertxt" userid="1" id="user1"> <img height="50" width="50" src="images/images.jpg"><strong>Test User 01</strong><ul><li>User ID: 1</li> <li>Email: [email protected]</li><li style="padding-top: 5px;"><input type="checkbox" class="selectit" value="1" id="select1"><label for="select1"> Select it.</label></li></ul></div>');
$('#all_users').append(new_data_var);
event is not called ?
Thanks