代码奉上:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>表单</title>
</head>
<body>
<h3>用户注册复习</h3>
<form action="http://www.itcast.cn">
<div>
<label>用户名</label>
<input type="text" name="">
</div>
<br>
<div>
<label>密码:</label>
<input type="password" name="">
</div>
<br>
<div>
<label>性别</label>
<input type="radio" name="gender">男
<input type="radio" name="gender">女
</div>
<br>
<div>
<label>爱好:</label>
<input type="checkbox" name="like">游戏
<input type="checkbox" name="like">逛街
<input type="checkbox" name="like">睡觉
</div>
<br>
<div>
<label>照片:</label>
<input type="file" name="">
</div>
<br>
<div>
<label>籍贯:</label>
<select>
<option>北京</option>
<option>上海</option>
<option>广州</option>
</select>
</div>
<br>
<div>
<label>个人描述</label>
<textarea></textarea>
</div>
<br>
<div>
<input type="submit" name="" value="提交">
<input type="submit" name="" value="重置">
</div>
</form>
</body>
</html>
效果:
效果
激活点击文字:
激活点击文字
lable中增加一个for属性,对应上字段的id。
method可以设置提交方式,默认是get,可以在地址栏中显示,可以修改为post,只能在报文中显示。










网友评论