user730569
user730569

Reputation: 4004

Problem with :not() selector

I'm trying to trigger an event if anywhere on the page is clicked except inside this one div. This is the beginning of the code:

$("html:not('#genre_div')").live("click", function(){

However, it seems that even if I click inside the #genre_div div, the code still gets executed. What am I doing wrong?

Upvotes: 0

Views: 47

Answers (1)

BoltClock
BoltClock

Reputation: 723498

:not() as a selector doesn't need quotes:

$("html:not(#genre_div)").live("click", function() {

Upvotes: 2

Related Questions