Ok so this is so so simple yet I cannot remember how it is done - shoot me! lets say for instance I had a button that when clicked, changed the background image for the main document. Thus allowing the user to choose a background image they want for my site. Any help
Here's an example that changes the background to the google logo. Just use a variable instead of the direct link to change it to what the user selected. <script type="text/javascript"> function changeBg() { document.body.background = 'http://www.google.com/intl/en/images/logo.gif' } </script> <input type="button" value="change" onClick="changeBg();" > Code (markup):
you can also change the className of the body with the onClick event and in the new class name, have a different background image.