I have this div
<div class="foodsSection">
<label>
Foods:
</label>
<ul>
<li>
roma
</li>
</ul>
</div>
and this jquery:
$(".foodsSection li").click(function(){
$(".addressesSection").css("display","block");
});
when I press on roma the jquery is working good, but when i press on any li that comes from database using jquery, the jquery is not working, this is the jquery which take the data form database and but it in li elements
$(document).ready(function(){
$(".RestauranstSection li").click(function (){
var divYourOrder = $(".YourOrder");
var li = $(".OMRestaurants li");
$(".foodsSection").css("display", "block");
var restaurantID = 8;
var foodDive = $(".foodsSection ul");
foodDive.html("");
var lis = '';
$.getJSON("http://localhost/TheEatTel/Food/getFoodForRestaurant/"+restaurantID+"/TRUE",function(data){
for(var i=0;i<data.length;i=i+3){
lis +="<li id='"+data[i+2]+"'>"+"<label>"+data[i]+"</label> <label>"+data[i+1]+"</label></li>";
}
lis+="";
foodDive.html(lis);
});
});
$(".foodsSection li").click(function(){
$(".addressesSection").css("display","block");
});
});