Jump to content

Changing background color.


Recommended Posts

Just something a little simple....

Simpley place in the body tags.



<input type="button"
onClick="document.bgColor = '#FFFFFF';">

<input type="button"
onClick="document.bgColor = '#008000';">

<input type="button"
onClick="document.bgColor = '#0000FF';">

<input type="button"
onClick="document.bgColor = '#FF0000';">

<input type="button"
onClick="document.bgColor = '#999999';">

<input type="button"
onClick="document.bgColor = '#000000';">



It will look like this...


and each color you click will change the background color.

Enjoy :)

Link to comment
Share on other sites

Re: Changing background color.

Well it all depends on what you want to do with it ...

Tezza just said it changes the background, not that it would store the current background for a later re-vist. you should read what people say. It's not because they say it changes the background it would also store it and disable the button for that color...

Link to comment
Share on other sites

Re: Changing background color.

No I'm not, however I don't like that people are always complaining. Not that It will ever change, but anyways I try to do something about it. If people read and understand what is posted, they can and should expect that the code works and does what the topic starter says.

If (s)he does not mention anything about something else, then it probably isn't there.

He did not say anything about storing the current background for later purposes, then why would one expect it?

If I read something that does not include storage, I don't expect it either ... Optimism is good though, but way to many people on here want to get spoiled with all kinds of stuff. Just look at this thread, it's like so many others, Matt says it's missing parts of the codes, but as far as I know tezza gave all code that is needed for this. Matt is expecting too much and didn't read what tezza's intentions were with posting this partial code. (No offense to matt or anything, it just happens to be a good example :p)

It isn't hard, I think ... or is it?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...