I'm trying to test if a number is greater than 0 but less than 8. How do I do that in JavaScript?
This is what I'm trying:
if (score > 0 < 8) { alert(score); }
I'm trying to test if a number is greater than 0 but less than 8. How do I do that in JavaScript?
This is what I'm trying:
if (score > 0 < 8) { alert(score); }
Here's the code:
if (score > 0 && score < 8){
alert(score);
}
P.S. This has nothing to do with jQuery. It's simple, naked JavaScript!
if ((score > 0) && (score < 8)) {
alert(score);
}
But this is JavaScript, not jQuery.
Try:
if(score > 0 && score < 8){alert(score);)