Changing background image with a button
I am trying to make a button that would change the background image of the whole document whenever somebody clicks it.
I have tried something along the lines of this:
Quote:
<input type="button"
value="Pattern1"
onClick="background-image: url(background.png);background-repeat: no-repeat;">
and,
Quote:
<input type="button"
value="Pattern2"
onClick="background: url(background.png);background-repeat: no-repeat;">
as you can see, I am a beginner at coding in general so any help is appreciated.
My assumption to why it doesn't work is that I am combining javascript with CSS, but I am most likely wrong. :(