ultimate-tester
02-26-2008, 09:15 PM
Hi all,
I'm busy making a site with some cool effects.. This is a part of my code:
<form name="changeColor">
<p><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">Kies een achtergrond kleur: <br> <br>
<input type="button" name="colr" value="ORANJE" onclick="document.bgColor='#FF9900'">
<br />
</font><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">
<input type="button" name="colr" value="WIT" onclick="document.bgColor='#FFFFFF'">
<br />
</font><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">
<input type="button" name="colr" value="ZWART" onclick="document.bgColor='#000000'">
</font> </p>
</form>
Now I want to change the TEXT color and BACKGROUND color. If you click ORANJE (orange), the text has to be black, if you press WIT (white), the text has to be also black, and if you press ZWART (black), the text has to be white. Now I know that the code for changing text color is
document.gfColor='#FFFFFF' but i don't know how to put that in the script, cause it doesn't work if I just place it behind the document.bgColor=blablabla
How do I put this in the code??
Thanks, Ultimate-Tester
I'm busy making a site with some cool effects.. This is a part of my code:
<form name="changeColor">
<p><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">Kies een achtergrond kleur: <br> <br>
<input type="button" name="colr" value="ORANJE" onclick="document.bgColor='#FF9900'">
<br />
</font><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">
<input type="button" name="colr" value="WIT" onclick="document.bgColor='#FFFFFF'">
<br />
</font><font size="2" face="Verdana,Arial,Helvetica,Sans Serif">
<input type="button" name="colr" value="ZWART" onclick="document.bgColor='#000000'">
</font> </p>
</form>
Now I want to change the TEXT color and BACKGROUND color. If you click ORANJE (orange), the text has to be black, if you press WIT (white), the text has to be also black, and if you press ZWART (black), the text has to be white. Now I know that the code for changing text color is
document.gfColor='#FFFFFF' but i don't know how to put that in the script, cause it doesn't work if I just place it behind the document.bgColor=blablabla
How do I put this in the code??
Thanks, Ultimate-Tester