I have a problem with jQuery selectors:
$("ul.questions li").not(".title, .content").click().live('click', function(){
$(".inspector").slideToggle();
if($(this).hasClass("selected")) {
$(this).removeClass("selected");
} else {
$(this).addClass("selected");
}
});
In that code it works if I remove .not(".title, .content")
. but if I add it, it just doesn't gets the click. I use live
because usually the elements are added through .append()
, except some ones. This is an example: http://jsfiddle.net/88w8N/ . Basically I want to handle click on the li element, but not if it clicks on the .title
and .content
divs. What I'm doing wrong? Thanks!