07-24-2023, 01:25 AM
I am getting a little confused with some code I am not sure why it will not work.
It is an If function ...
if (calorie_total<100)
{
$("#awards_info").html('bad');
}
else if (200>calorie_total>100)
{
$("#awards_info").html('okay');
}
else if (400>calorie_total>300)
{
$("#awards_info").html('good');
}
else (calorie_total>400);
{
$("#awards_info").html('great');
}
Bascailly it is looking at the total calories and then telling you how well you have done.
But for some reason it allways says "great" even when calories are less than 0?
Any ideas would be great?
Thank you
It is an If function ...
if (calorie_total<100)
{
$("#awards_info").html('bad');
}
else if (200>calorie_total>100)
{
$("#awards_info").html('okay');
}
else if (400>calorie_total>300)
{
$("#awards_info").html('good');
}
else (calorie_total>400);
{
$("#awards_info").html('great');
}
Bascailly it is looking at the total calories and then telling you how well you have done.
But for some reason it allways says "great" even when calories are less than 0?
Any ideas would be great?
Thank you