您的位置:首页 > Web前端 > CSS

HTML&CSS基础学习笔记1.26-input标签重置表单

2016-08-23 09:49 1086 查看
重置表单

<input>的[type]属性值为"button"的时候表示一个普通的按钮,相当于一个<button>标签。

<input>的[type]属性值为"reset"时,表示表单重置,它在页面的表现形式也是个按钮,但点击他的时候会让表单重置到页面刚加载时的状态。

看一段代码吧:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="index.css">
<title>表单</title>
</head>
<body>
<form action="/" method="get">
<h2>input标签 -- 重置表单</h2>
<p><label for="account">账号:</label><input type="text" id="account"/></p>
<p><label for="psd">密码:</label><input type="password" id="psd"/></p>
<input type="reset" value="重置">
</form>
</body>
</html>更多学习内容,就在码芽网http://www.mayacoder.com/lesson/index
结果是这样的:



重置后:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息