I have this jquery code :
var regexparam="([^a-zA-Z ])";
if(thisValue.match(regexparam))
{
$(parentId).children('span').addClass('red').html('✕ Firstname cannot contain numbers or symbols.');
}
else if($.trim(thisValue)=="")
{
$(parentId).children('span').addClass('red').html('✕ Firstname cannot be empty.');
}
else
{
$(parentId).children('span').addClass('green').html('✔ So you\'re '+ thisValue+'.');
}
The 'red' class is being rendered when the user inputs wrong information... While the 'green' class doesn't apply and revert back to it's default color.
I checked on the firebug and the class is being rendered and I can see that both green and red class is being applied to the element.
Here's my css:
.red{color:red;};
.green{color:green;};