1.png
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单</title>
<style>
</style>
</head>
<body>
<!-- action 要提交的地址 -->
<form action="">
用户名 <input type="text" placeholder="请输入用户名" name="username">
<br>
密码 <input type="password" placeholder="请输入密码" name="password">
<br>
单选框<input type="radio" name="sex" value="boy" checked>男
<input type="radio" name="sex" value="gril">女
<br>
复选框<input type="checkbox" name="hobby" value="football" checked>>足球
<input type="checkbox" name="hobby" value="handball">篮球
<input type="checkbox" name="hobby" value="paiqiu">排球
<input type="checkbox" name="hobby" value="pingpongqiu">乒乓球
<br> <br>
下拉列表
<select name="activity">
<option value="one">111</option>
<option value="one" selected>222</option>
<option value="one">333</option>
</select>
<br> <br>
颜色选择<input type="color">
<br> <br>
<input type="submit">
<br> <br>
<input type="submit">
<input type="reset">
<input type="button" value="111">
<br> <br>
<button type="submit">提交</button>
<button type="reset">重置</button>
<button type="button">按钮</button>
<br> <br>
<!-- autocomplete="off" 关闭自动补全 -->
<input type="text" name="username" autocomplete="off">
<br> <br>
<!-- readonly 只读 数据会提交-->
<input type="text" name="username" value="123" readonly>
<br> <br>
<!-- disabled 禁用 数据不会提交 -->
<input type="text" name="username" value="123" disabled>
<br> <br>
<!-- autofocus 自动获取焦点 -->
<input type="text" name="username" autofocus>
</form>
</body>
</html>
网友评论