My jQuery is a little rusty, hence this noob question:
I have this unordered list,
<ul data-role="listview" id="list-all-forms">
</ul>
which I populate from a JSON-object:
function updateChecklists(){
requestAllForms = $.get("/list-all-forms");
requestAllForms.promise().done(function(data){
$.each(data,function(key, val){
$("<li><a class='checklistObject' id='" + val.id +"'>" + val.name +"</a></li>").appendTo("#list-all-forms");
});
$('ul').listview('refresh');
});
};
However, when I try to get the click event from a link with the class checklistObject in the list, nothing happens...
$(".checklistObject").on("click", function(){
console.log("click on list object!");
});
How can I get that function to fire?