Hi all

It would be useful to be able subtract a list of elements generated
from a compound selector - from the results of another.

I thought I might be able to do this using what is documented as
$(obj) within a .not() but isn't working for me. Perhaps there is a
good reason it's failing?

Here's a silly simplistic example, where I want to select the
paragraphs that are not bold and don't have a class of 'odd':

var evenweak = $("p").not(".odd").not("[b]");

// This works but I want the opposite
$( evenweak ).css("color","red");

// These don't work (the not is ignored)
$("p").not( $( evenweak ) ).css("color","red");
$("p").not( $( evenweak ).get() ).css("color","red");

With this HTML:
<p class="odd"><b>one</b></p>
<p><b>two</b></p>
<p class="odd">three</p>
<p>four</p>

Before you suggest one of the many easier ways to do this - I know
this example is less than sensible with this example HTML. My real
problem is more complex - just want to kill off this direction before
I try another.

Any insights?
Cheers
Ollie

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to