Convert with parseInt and then compare int to int instead of strings https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Functions/ParseInt
- Richard On Thu, Dec 10, 2009 at 12:26 PM, evanbu...@gmail.com <evanbu...@gmail.com>wrote: > I having trouble with this line > > if (td4th.text() > '4') || (td4th.text() > '2' && (activeCEO == > 'Yes')) > > In plain English, I want it to be true if > > td4th > 4 > > OR > > td4th > 2 AND activeCEo = 'Yes' > > Thanks > > > $('#tblBoardDirectors tr').each(function() { > var relStatus = ($('td:nth-child(5)', $(this)).text()) > var activeCEO = ($('td:nth-child(12)', $(this)).text > ()); > { > if (relStatus != 'Retired') { > var td4th = $('td:nth-child(4)', $ > (this)); > if (td4th.text() > '4') || (td4th.text() > > '2' && (activeCEO == 'Yes')) > td3rd.addClass(bgColor); > } > } > }); > > >