qfedu-web/www/form2.html

46 lines
1.4 KiB
HTML
Raw Normal View History

2023-09-14 12:03:17 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="flykhan" />
<meta name="keywords" content="c c++ 物联网" />
<title>表单2</title>
</head>
<body>
<h3>注册用户</h3>
<form enctype="multipart/form-data" method="get" action="">
<input name="username" value="flykhan" /><br />
<input name="pwd" type="password" /><br />
<!-- 标签的属性名和属性值是相同的情况下,只需要写属性名即可 -->
<input type="radio" name="sex" value="男" />
<input type="radio" name="sex" value="女" checked />
<br />
<input type="checkbox" name="loves" value="c语言" />c语言
<input type="checkbox" name="loves" value="c++" />c++
<input type="checkbox" name="loves" value="linux" />linux
<input type="checkbox" name="loves" value="H5" />H5
<br />
<input
type="color"
name="love_color"
onchange="changePageColor(this.value)"
/>
<input type="file" name="head" /><br />
<input type="hidden" name="user_id" value="1" />
<button>提交</button>
</form>
<script>
function changePageColor(color) {
// 控制台输入传入的参数值
console.log(color);
document.getElementsByTagName("body")[0].style = "color:" + color + "";
}
</script>
</body>
</html>