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

重置表单

<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

结果是这样的:


重置后:



 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章