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
Post a Comment