I'm trying to get the text from tag <a>
in element <li>
but it doesn't work.
for (i = 0; i < result.length; i++) {
$("#ftrBtn-menu_Facility").append("<li id='ftrBtn-menu_Facility_" + (i) + "'><a href='#'>" + result[i].facility + "</a></li>");
$("#ftrBtn-menu_Facility_" + (i)).click(function(){
var text = $("#ftrBtn-menu_Facility_" + (i)).find("a:first").text();
alert(text);
});
}