Looks good. Might also want to make sure the text value is a number.
Maybe do a conversion or something.

if (parseInt($(this).text()) > 90)

On Mar 12, 12:15 pm, Charlie Griefer <charlie.grie...@gmail.com>
wrote:
> disclaimer: n00bie code (seems to work, but might not be particularly
> elegant) :)
>
> $(function() {
> $('.numericColumn').each(function() {
> if ($(this).text() > 90)
> $(this).parent().css('backgroundColor', 'red');
>
>
>
> });
> });
> On Thu, Mar 12, 2009 at 12:33 PM, Lars <lar...@gmail.com> wrote:
>
> > I am totally new to jQuery. I wonder if it's possible to change the
> > background color of any row in the table below where the value of the
> > table cell belonging to class "numericColumn" is greater than 90? The
> > values in this column will always be numeric.
>
> > Thanks for any help, Lars
>
> >            <table class="importResults">
> >                <tbody>
> >                    <tr>
> >                        <td>0</td>
> >                        <td class="numericColumn">66</td>
> >                        <td>No significant changes</td>
> >                    </tr>
> >                    <tr>
> >                        <td>491</td>
> >                        <td class="numericColumn">1</td>
> >                        <td>Failed DPV because of invalid primary</td>
> >                    </tr>
> >                </tbody>
> >            </table>
>
> --
> I have failed as much as I have succeeded. But I love my life. I love my
> wife. And I wish you my kind of success.

Reply via email to