www.webdeveloper.com
Results 1 to 3 of 3

Thread: background colour

  1. #1
    Join Date
    Oct 2004
    Posts
    2

    background colour

    Hi

    In a web page, is it possible to change the background colour (bgcolor) using an expression in javascript to a new Hexadecimal value? - because I tried document.bgcolor, body.bgcolor etc., but none of them worked.

    Thanks very much

  2. #2
    Join Date
    Nov 2003
    Location
    Derby, UK
    Posts
    87
    Try...
    Code:
    document.body.style.backgroundColor="#rrggbb";
    (This will work in IE, I cannot say for other browsers.)

    Tom

  3. #3
    Join Date
    Oct 2004
    Posts
    2
    thanks very much

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