Probably could but there comes a time when too much terseness is a bad thing
(a little can go a long way, as in your original example!). That to me is
one of the key things to figure out when programming - how terse can I be
vs. how terse should I be. :) Though I must say, that is powerful! Any
difference in speed of execution? I am going to have to go back to my jQuery
code from a few weeks ago when I discovered it and revamp some of the things
I've done since!
Karl Swedberg-2 wrote:
>
> Thanks. :) Yeah, selectors are a kind of hobby for me. Sad, I know.
>
> Anyway, I'm thinking we can make it even more terse this way:
>
> $('tr[td:contains("term")]').addClass('foo');
>
> Cheers,
> Karl
>
> On Feb 8, 2007, at 2:38 PM, James Thomas wrote:
>
>>
>> Wow, that is terse! I like it. I really need to get better at
>> selectors as
>> that wouldn't have occurred to me. Nice.
>>
>> James
>>
>>
>> Karl Swedberg-2 wrote:
>>>
>>> Hi Graeme,
>>>
>>> Try something like this:
>>>
>>> $('td:contains("term")').parent().addClass('foo');
>>>
>>>
>>> --Karl
>>> _________________
>>> Karl Swedberg
>>> www.englishrules.com
>>> www.learningjquery.com
>>>
>>>
>>>
>>> On Feb 8, 2007, at 1:16 PM, Graeme B. Davis wrote:
>>>
>>>> Hello,
>>>>
>>>> I'm looking to highlight 1 or more rows of a table which have a
>>>> cell whose contents match a search term I provide. Does anyone
>>>> have an easy way to do this?
>>>>
>>>> Thanks!
>>>>
>>>> Graeme
>>>> _______________________________________________
>>>> jQuery mailing list
>>>> [email protected]
>>>> http://jquery.com/discuss/
>>>
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> [email protected]
>>> http://jquery.com/discuss/
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/Search-term-
>> table-row-highlighting-best-practice-tf3194998.html#a8872600
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> [email protected]
>> http://jquery.com/discuss/
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
--
View this message in context:
http://www.nabble.com/Search-term-table-row-highlighting-best-practice-tf3194998.html#a8874715
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/