<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<script type="text/javascript">
function change(){
var bgColor=document.getElementById("txtId").value;//获取输入的颜色值
var _body=document.getElementsByTagName("body");//获取页面属性
_body[0].style.backgroundColor=bgColor;
}
</script>
</style>
<body>

修改背景色: <input type="text" />

</body>
</html>

相关文章:

  • 2021-08-05
  • 2021-12-12
  • 2021-11-04
  • 2022-01-14
  • 2021-12-27
  • 2021-12-04
猜你喜欢
  • 2021-12-19
  • 2021-11-23
  • 2022-01-03
  • 2021-05-18
  • 2021-04-21
  • 2021-09-19
  • 2021-12-21
相关资源
相似解决方案