Friday, May 29, 2009

[jQuery] Re: tilde (~) selector

It does. It returns b and d as expected!
 
Try:
$('p ~ p').css('color', 'red')
and b and d will be red
 
Maurício
-----Mensagem Original-----
Hi,
I...
<html>
  <head><script src="http://code.jquery.com/jquery-latest.js"></
script></head>
  <body>
    <p>a</p>
    <p>b</p>
    <div>c</div>
    <p>d</p>
  </body>
</html>

..
 But $
('p ~ p') doesn't return anything... I
...

No comments: