Question: Could someone please help with the following jQuery

***I need all jQuery UI buttons that are not children of two tables #id1 and #id2 and not of classid=x***

What I have come up with so far is 

```
$(":button(.ui-button .ui-widget):not(#table1 #table2):not(.MyCustomClass)") 

```

but this doesnt seem to work...

What am I missing?

Answer: 
I think you want:

```
$(':button.ui-button, :button.ui-widget').not('#table1 *, #table2 *').not('.MyCustomClass')

```

It's usually faster to break the qualifiers out of the selector.
Try ([demo](http://jsfiddle.net/Mottie/63Nrx/)):

```
$('table:not(#table1, #table2) .ui-button:not(.MyCustomClass)')

```