$(document).on("click", "li", function() {alert("A list item was clicked");}
I'm using the above code to perform an action on every list item but list dividers are also proccing this event.
I managed to exclude my close button using
$(document).on("click", "li", function() {
if (this.id !== "closeButton") {
alert("A list item was clicked");
}
});
however I can't stop it from occurring on list dividers. I've tried to no avail
$(document).on("click", "li", function() {
if (this.class !== "ui-li-divider") {
alert("A list item was clicked");
}
});
Here's a JSFiddle with the problem: http://jsfiddle.net/2g3w5/