jsFiddle: http://jsfiddle.net/Mw4j2/6/
Trying to change attributes to a selector if the seconds count is 10 or under.
I’m using
var returnSecondsNumber = $('.countdownSecond > .countSeconds > .position:first-child > .digit').text() + $('.countdownSecond > .countSeconds > .position:nth-child(2) > .digit').text();
To grab the numbers from both spans and returns it as 16/15/14/etc.
Now I need do something if this numeric is under 10.
e.g.
if (returnsSecondsNumber <= 10)
{ $(this).addClass('urgent');
}, else { //do something
}
I’ve tried taking a look at parseInt with no success. Any help would be much appreciated!
Thanks.
Two things:
Second, just use
parseInt():