I\'m new to javascript and this is driving me nuts. I\'m attempting to set the text and color of a label (\"lblerrmsg\") depending upon the value of a flag (\"IsValid\"). I\'ve
ErrMsg.outerHTML = 'valid';
If you do that, you have destroyed the previous ErrMsg and the new content will not have the id anymore (so that it cannot be found by getElementById).
Are you sure you don't want innerHTML?
try to change the class name of the div or element to change the css style if you want
document.getElementById("blah").className = "cssclass";
this way you can control the css depending on the flag of yours.