I have a simple click event using the on
function:
$('#listnav li').on({
click: function(event) {
console.log('hello world')
},
mouseover: function(event) {
// do something
}
});
This is working for the ul list with id "listnav". But when I am adding new entries to the ul using jQuery's append
function, this function is not called on the new added list items. How can I fix this?