1.7 input系列标签按钮
★场景: 在网页中显示不同功能的按钮表单控件
★type属性值:
标签名 | type属性值 | 说明 |
input | submit | 提交按钮。点击之后提交数据给后端服务器 |
input | reset | 重置按钮。点击之后恢复表单默认值 |
input | button | 普通按钮。默认无功能,之后配合js添加功能 |
★注意点:
· 如果需要实现以上按钮功能,需要配合form标签使用
· form使用方法:用form标签把表单标签一起包裏起来即可
· value:给按钮添加显示文字
<body>
<form action="">
用户名:<input type="text">
<br>
<br>
密码:<input type="password">
<br>
<br>
<!-- 按钮 -->
<input type="submit" value="免费注册">
<input type="reset">
<input type="button" value="普通按钮">
<!-- 属性 xx="xxx" -->
</form>
</body>