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

php - Hide output during test execution -

javascript - Migrate custom AngularJS filter from 1.2.28 to 1.4.x -

Update Magento products with multiple images -