Results 1 to 2 of 2

Thread: how to change text color in text area-javascript

  1. #1
    druveen Guest

    how to change text color in text area-javascript

    I am having a color picker which gives a color code , i have to change the color of text/font in textarea according to color code generated dynamically.... i am unable to use color code to change the text color plz help

  2. #2
    Join Date
    May 2009
    Location
    England
    Posts
    165
    Hello druveen,

    You might need to post some of your code to make sense.

    But, something like this should work:

    <input type="hidden" id="chosenColour" value="#ABCDEF" />

    <div onclick="document.getElementById('changeMe').style.color=document.getElementById('chosenColour').val ue;">Change the colour</div>

    <div id="changeMe">I will change colour!</div>

    Of course you need to integrate that with your colour picker but hopefully you get the idea.

    (Sorry for the *correct* spelling of colour for all you US folks )

    Regards,


    David
    David McLeary
    Emerging Innovations
    Website Development, Training and Consultancy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •