Getelementbyid Succeeds Once Then Returns Null
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 written a
Solution 1:
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?
Post a Comment for "Getelementbyid Succeeds Once Then Returns Null"