If mytext is a string, make sure it's quoted as said before.  Your jquery
selector looks ok (I did something similar recently and it works great)

cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


                                                                       
  From:       SteelRing <steelr...@gmail.com>                          
                                                                       
  To:         "jQuery (English)" <jquery-en@googlegroups.com>          
                                                                       
  Date:       02/10/2009 05:51 PM                                      
                                                                       
  Subject:    [jQuery] Re: using :has with selector                    
                                                                       






This is going to select the td, whereas I need to select the tr.

On Feb 10, 4:41 pm, "Mauricio \(Maujor\) Samy Silva"
<css.mau...@gmail.com> wrote:
> TD is a TR children so use the CSS descendant selector tr td.
>
> $("#tableid tbody tr td.someclass:contains('mytext'))").dosomething();
>
> PS: mytext is a string and should be quoted.
>
> Maurício
>
> -----Mensagem Original-----
> De: "SteelRing" <steelr...@gmail.com>
> Para: "jQuery (English)" <jquery-en@googlegroups.com>
> Enviada em: terça-feira, 10 de fevereiro de 2009 19:57
> Assunto: [jQuery] using :has with selector
>
>
>
> > Anyone can think of a reason why this shouldn't work? I'm trying to
> > select the Row (tr) where the cell of td with class "someclass"
> > contains "mytext". Since I want to work on the row (tr) itself, I need
> > to use :has because I don't need to select the td itself. Am I wrong
> > or am I wrong?
>
> > $("#tableid tbody tr:has(td.someclass:contains(mytext))").dosomething
> > ();

<<inline: graycol.gif>>

<<inline: ecblank.gif>>

Reply via email to