开发者

Problem with :not() selector

开发者 https://www.devze.com 2023-03-09 07:17 出处:网络
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:

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", fu开发者_Python百科nction(){

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


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

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

精彩评论

暂无评论...
验证码 换一张
取 消