<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title><script>window.onload = open;function open() {var menu = document.getElementById("menu");menu.onchange=function(){var bgcolor = this.value;if(bacolr=="")return;document.body.style.background=bgcolor}}</script></head><body><div class="box">请选择背景颜色:<select name="" id="=menu"><option value="">请选择</option><option value="#foo">红色</option><option value="#ofo">绿色</option><option value="#oof">蓝色</option><option value="#ff0">黄色</option><option value="#ccc">灰色</option></select></div></body></html>
添加回答
举报
0/150
提交
取消