Question: I've created an NSButton (see code below). The button displays the way I want (borderless, with image above text). If I click the text portion of the button the button will press down and call it's action. If I click the image portion of the button then absolutely nothing happens. How can I make the image portion of the NSButton clickable? I'm sure I can subclass the NSButtonCell to make this work, but I don't understand why that would be necessary.

```
NSButton *button = [[NSButton alloc] initWithFrame:NSZeroRect];
[button setBezelStyle:NSRegularSquareBezelStyle];
[button setBordered:YES];
[button setImagePosition:NSImageAbove];
[button setButtonType:NSMomentaryChangeButton];
[button setImage:[NSImage imageNamed:@"myImage"]];
[button setTitle:@"Button Title"];
[button setTarget:self];
[button setAction:@selector(buttonAction:)];

```

Answer: 
You can use [`.not`](http://api.jquery.com/not/), which will filter all the elements you selected:

```
$('span.c3, span.c4').not('.c5').parents('a').click(function (e) {
    alert("clicked!");
});

```

BTW, are you sure what you want is [`parents`](http://api.jquery.com/parents/)? I think what you really want is [`closest`](http://api.jquery.com/closest/).

---

Here's the fiddle: <http://jsfiddle.net/GCNKg/>

---

**Update**: Since you mentioned in the comments that you have to use the `:not` selector because you're using event delegation, you'll have to either add `:not` to *every* selector, or just add the following filter to your script:

```
$.expr[':'].any = $.expr.createPseudo(function( selector ) {
    return function (el) {
        return $.find.matches(selector, [el]).length > 0;
    }
});

```

This adds the [`:any`](https://developer.mozilla.org/en-US/docs/CSS/:any) selector to jQuery/Sizzle (I based it off of [this jQuery feature request](http://forum.jquery.com/topic/feature-req-any-selector-filter), but updated it so that it works with [the new Sizzle selector engine used by jQuery since version 1.8](https://stackoverflow.com/questions/11624345/getting-the-match-object-in-a-custom-filter-selector-in-jquery-1-8)).

Once you have that filter included, you can use `:any` in your selectors, which'll work nicely with `:not`:

```
$(document.body).on('click', 'span:any(.c3, .c4):not(.c5)', function (e) {
    alert("clicked!");
});

```

Here's the fiddle: <http://jsfiddle.net/GCNKg/1/>
Use the [`.not()`](http://api.jquery.com/not/) function, rather than the selector. For example:

```
$('span.c3, span.c4').not('.c5').parents('a').click(function (e) {
    alert("clicked!");
});

```

Here's a [jsFiddle demo](http://jsfiddle.net/SNHSH/).