Tura Posted December 15, 2005 Share Posted December 15, 2005 I am trying to find a way that you can scroll down a dropdown menu and the background color will change. I tried the html code that showed the dropdown box that did nothing and tried to get it to change the background color, but I could not. This is one of the things I tried: <form action="background color" method="change"><select name="background"> <option value="black">black <option value="bisque">bisque <option value="blue">blue <option value="cadetblue">cadetblue <option value="chocolate">chocolate <option value="coral">coral <option value="crimson">crimson <option value="cyan">cyan <option value="darkblue">dark blue <option value="darkcyan">darkcyan <option value="darkgreen">darkgreen <option value="darkorange">darkorange <option value="darkorchid">darkorchid <option value="darkred">darkred <option value="darkviolet">darkviolet <option value="deeppink">deeppink <option value="dimgray">dim gray <option value="dodgerblue">dodgerblue <option value="firebrick">firebrick</select></form> Link to comment Share on other sites More sharing options...
Chocolate570 Posted December 16, 2005 Share Posted December 16, 2005 <script type="text/javascript">function goThing(){x=document.forms[0].elements["background"]zoop=x.options[x.selectedIndex].value;document.body.bgColor=zoop}</script><form><select name="background" onchange="goThing()"><option value="black">Black<option value="bisque">Bisque<option value="blue">blue <option value="cadetblue">cadetblue<option value="chocolate">chocolate<option value="coral">coral<option value="crimson">crimson<option value="cyan">cyan<option value="darkblue">dark blue<option value="darkcyan">darkcyan<option value="darkgreen">darkgreen<option value="darkorange">darkorange<option value="darkorchid">darkorchid<option value="darkred">darkred<option value="darkviolet">darkviolet<option value="deeppink">deeppink<option value="dimgray">dim gray<option value="dodgerblue">dodgerblue<option value="firebrick">firebrick</select></form> Works like a charm for me. Link to comment Share on other sites More sharing options...
Tura Posted December 16, 2005 Author Share Posted December 16, 2005 Oh. That worked. Thanks! =)Would that be almost the same for changing text colors, too? Link to comment Share on other sites More sharing options...
Chocolate570 Posted December 16, 2005 Share Posted December 16, 2005 Where you see "bgColor" change it to "color" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now