码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2016-08-26 10:24:41      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

重置表单

<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

结果是这样的:

技术分享

重置后:

技术分享

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

标签:

原文地址:http://www.cnblogs.com/malimalihong/p/5809164.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!