You could use an adjacent selector:

$('p+b')

would work for your sample markup, but would need a bit of care
depending on the real use situation.


On Oct 31, 11:41 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Assume, I have the following HTML:
>
> <p><b>Text1</b></p>
> <b>Text2</b>
>
> How can I select the second <b>, which is not a child of a <p>? As I
> am a newbie, I played a little bit around with :not, filter(), but
> unfortunately
>
> $('b').filter(":not(p > b)") => both <b> are selected.
>
> $('b').not('p > b')        => both <b> are selected.
>
> Any hints?
> Jochen

Reply via email to