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>
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>