1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

How to insert colored text in html page using javascript

Discussion in 'JavaScript and AJAX' started by anchitjindal07, Mar 4, 2011.

  1. anchitjindal07

    anchitjindal07 New Member

    Joined:
    Jul 13, 2009
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    I am inserting text in html page using javascript..But the font-color of this text is black by default. How to change the color of this text??

    I am using createTextNode() and appendChild() functions to insert the text but not able to change the color using style.color property. How to accomplish this?
    Please help..
    Thanks a lot...
     

Share This Page