Web Analytics Made Easy -
StatCounter Swapping the document.bgColor - CodingForum

Announcement

Collapse
No announcement yet.

Swapping the document.bgColor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Swapping the document.bgColor

    Hey everyone,
    Any help would be greatly appreciated!! :] Heres what I want to accomplish:

    -Create a button

    -Swap color when
    clicked it will
    swap background
    color with a user
    chosen color and
    the original color

    -Prompt for background
    choice

    -Each time the button is
    clicked, the background
    color is exchanged
    between the original and
    user's choice.

    The following code is where I'm currently at:

    <html>
    <head>
    <title>Your Color!!!</title>
    <script language=javascript>
    var color;
    var color1=white
    function changecolor(){
    color=prompt("To what color do you wish for the scheme of this page to be?")
    document.bgColor=color;
    document.bgColor=white;
    };
    </script>
    <form>
    <input type="button" value="Change Color" onClick="changecolor()">
    </form>
    </head>
    </html>

    Im lost and I need your help please.

    Thanks a bunch,
    Tim
    Last edited by becool0130; Oct 7, 2006, 01:09 AM.

  • #2
    And the reason for starting a new thread about this when you already had one open was? http://www.codingforum.net/showthread.php?t=97845
    Don't waste our time.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

    Comment

    Working...
    X