<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script>
function changeBg(){
var bgColor="";
for(var i=0;i<6;i++){
bgColor+=""+Math.round(Math.random()*9);
}
document.body.style.backgroundColor="#"+bgColor;
}
document.onclick=changeBg;
</script>
</head>
<body>
</body>
</html>
html实现点击鼠标改变背景颜色
最新推荐文章于 2023-04-21 11:31:22 发布