Trying to set this label to red
I’ve got the following class:
.redErrorText
{
color: #b11010;
}
The following label:
<label for="txtNumber" id="lblBlue">Number 1</label>
And then this code runs to try and set the label to red:
var blueLabel = "#lblBlue";
$(blueLabel).addClass("redErrorText");
I can’t figure out what I could be doing wrong here, looks fine to me.
Are you using webforms? because if you are then the ID you’re expecting may not be the one you have. it may have some dopey stuff after it.
try looking at it in source view from the browser and check the it.
also try something like this if you are using webforms;
if it’s ok then are you loading jQuery?