javascript problem!

houssam_ballout

New Member
Hello all,
please can u tell me what is the problem with my code?
Also, please can some one explain for me the implemented function (that code is from the w3schools)?
thanks.

<html>
<body>

<script language="javascript">

function change()
{
document.bgColor=document.list.colors.options
[document.list.colors.selectedIndex].value;
}
</script>

<p>My first background changer:
<form name="list">
<select name="colors">
<option value="red">Red
<option value="blue">Blue
<option value="green">Green
<option value="orange">Orange
<option value="white">White
</select>
<input type="button" value="Change Background color!"
name="myButton" onClick="change()" />
</form>

</p>
</body>
</html>
 
houssam_ballout said:
Hello all,
please can u tell me what is the problem with my code?
Also, please can some one explain for me the implemented function (that code is from the w3schools)?
thanks.

ummm.. I just copied your code into HTML kit and the background color changed just like it was supposed to!
 
Back
Top