Jump to content

onClick


Hellusius

Recommended Posts

I try to modify the background color when the usser clicks on a radiobutton, frankly nothing happens so far.

[code]
<form><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Normal" checked>Normal</a><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Light">Light</a><br>
<input type="radio" name="bgcolor" onClick="document.bgcolor= class="Dark">Dark</a><br>
</form>
[/code]

I put in the little CSS code which looks like this
[code]
<style type="text/css">
.dark {background-color: #335588};
.Light {background-color: #7799CC};
.Normal {background-color: #5577AA};
</style>
[/code]

ant suggestion why it doesn't work, cause I have seen it been done before
Link to comment
https://forums.phpfreaks.com/topic/15999-onclick/
Share on other sites

I got it working now with the following code

[code]<input type="radio" name="bgcolor" onClick="document.bgColor='5577AA'">Normal</a><br>
<input type="radio" name="bgcolor" onClick="document.bgColor='7799DD'">Light</a><br>
<input type="radio" name="bgcolor" onClick="document.bgColor='335588'">Dark</a><br>[/code]

But now would I like to save it so it keeps having that background through all pages as well, is that a possiblity?
Link to comment
https://forums.phpfreaks.com/topic/15999-onclick/#findComment-65792
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.