| オプションメニューで背景色を選択 |
|
|
| ■<head>〜</head>内に下記を貼り付けてください。 |
<script language="JavaScript">
<!--
function changeColor(){
num=document.myform.bgselect.selectedIndex;
if(num==0){
document.bgColor="white";
}else if(num==1){
document.bgColor="yellow";
}else if(num==2){
document.bgColor="red";
}else if(num==3){
document.bgColor="blue";
}
}
// -->
</script> |
| ■<body>〜</body>内に下記を貼り付けてください。 |
<form name="myform">
<select name="bgselect">
<option selected>white </option>
<option>yellow</option>
<option>red</option>
<option>blue </option>
</select>
<input type="button" value="変 更" onclick="changeColor()">
</form> |