www.webdeveloper.com
Results 1 to 3 of 3

Thread: Escape character not working in Color

Hybrid View

  1. #1
    Join Date
    Mar 2012
    Location
    Ghent
    Posts
    22

    Escape character not working in Color

    I can't seem to output the color code with the quotes around it.. thanks!

    Code:
    function changeColor(){
        document.body.style.backgroundColor = '\"#' + 56AA11 '\"';
    }

  2. #2
    Join Date
    Mar 2011
    Posts
    1,133
    Quotes are illegal in setting the background color. Just use:
    Code:
    function changeColor(){
        document.body.style.backgroundColor = '#56AA11';
    }
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Mar 2012
    Location
    Ghent
    Posts
    22
    Oh but I want to use a variable to set the color later is this possible?. thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles