-1

我有这个,但它得到一个错误:

$('#Photocell').on('click', 'div.group:not('.overrideIcon')', function(){...});

我应该在 not() 中使用双引号吗?

4

2 回答 2

4

Try this:

$('#Photocell').on('click', 'div.group:not(.overrideIcon)', function(){...});

No need of single quotes for the overrideIcon class inside :not()

于 2013-04-18T17:34:50.633 回答
3

Since there are no spaces, you can simply omit the quotes:

$('#Photocell').on('click', 'div.group:not(.overrideIcon)', function(){...});

Safer way is inverting the quotes:

$('#Photocell').on("click", "div.group:not('.overrideIcon')", function(){...});
于 2013-04-18T17:34:59.347 回答