Jump to content

Input/Drop-Down Menu


Tura
 Share

Recommended Posts

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

<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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...