Egghead Posted January 18, 2007 Share Posted January 18, 2007 Hey all, I am working on just an experimental website right now; I learned the basics of html, xhtml, and css, so the site has elements of each; anyways, now I am learning Javscript so I can then learn XML afterwards. But my question is, for the text displayed in Javascript, how do I change the color of it? I have a black background on my website, so the text from the Javascript is not viewable unless I change the background to a different color. The regular text from the html is viewable because I changed its color, first via html, and then via a css, but I can't figure out how to change the text color of the Javascript text. How do I do this?Thanks,---Egghead--- Link to comment Share on other sites More sharing options...
aspnetguy Posted January 18, 2007 Share Posted January 18, 2007 <div id="mytext"></div><script> var wrapper = document.getElementById("mytext"); wrapper.style.color = "#ffffff"; //white wrapper.appendChild(document.createTextNode("some new text"));</script> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now