I'm trying to make a site where the user can click on any element to edit it's css. I use the following to add the click function to all lis, divs and uls.
$('li,div,ul').click(function () {
alert(this.id);
});
The problem is if I click on an li element, then I get the alert for that, and any element underneath it. (all the containers).
Is it possible to have only the top element trigger when clicked?