javascript - How to change colour of text when using document.getElementById("id").innerHTML -


i trying change text of span else when particular event occurs. doing :

document.getelementbyid("usernameerror").innerhtml = "**message"; 

i want display same in different colour. idea on how that? appreciated!

you put message in span , put style attribute on it. should it:

document.getelementbyid("usernameerror").innerhtml = "<span style='color: red;'>**message</span>"; 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -