hey all,
i have this line of code:
document.getElementById("MESSAGE").innerHTML = total + " out of 24";
total is a variable that calculates the number of characters typed into a field. i need to have a red box appear around the total + " out of 24" if the total is > 24. here's what i have so far:
if ( total > 24 )
{
document.getElementById("MESSAGE").innerHTML = "<span style='border: 1px solid red; padding: .5em>" total + " out of 24</span>";
}
else
{
document.getElementById("MESSAGE").innerHTML = total + " out of 24";
}
this is obviously wrong because when the page loads i lose the "total out of 24" entirely. i'm pretty sure i'm just having syntax issues, but please advise!!
thanks...