<input type="Button" value="Colour One" onclick="document.bgColor = 'Red'" /> <input type="Button" value="paypal" onclick="document.bgColor = 'Blue'" /> <input type="Button" value="Colour Three" onclick="document.bgColor = 'Green'" /> i am using this script but my webpage is not changing colours like in css you write >>>!important <<< at the end is there anything similar in javascript like that
View attachment change_bg_color.html Here you go: The attached file -- view the source and you can adapt it for you needs.
so is jqueary better then javascripts and do you know any website which has good tutorials and good way to learn thank you
You don't need jQuery for something as simple as this. In any case, it should be working properly. Try the following: <html> <body> <input type="Button" value="Colour One" onclick="document.bgColor = 'Red'" /> <input type="Button" value="paypal" onclick="document.bgColor = 'Blue'" /> <input type="Button" value="Colour Three" onclick="document.bgColor = 'Green'" /> </body> </html> Code (markup):
its better to use document.body.bgColor rather than document.bgColor.. <input type="Button" value="Colour One" onclick="document.body.bgColor = 'Red'" /> <input type="Button" value="paypal" onclick="document.body.bgColor = 'Blue'" /> <input type="Button" value="Colour Three" onclick="document.body.bgColor = 'Green'" /> HTML: