:not and multiple selectors bug?

:not and multiple selectors bug?

Hi, I am trying to write a jQuery selector to give me all anchors tags and submit inputs within a div that are not children of a sub div of a certain class, to apply the button() ui to them... See below:

$("#mainDiv a:not(.exclude a), #mainDiv input:submit:not(.exclude input)).button()

For some reason this keeps giving me all anchors. If I split the jQuery selector into two separate queries at the comma, the two individual queries work fine.

Am I doing something wrong, or is this a bug?

Thanks