首页 > Web开发 > 详细

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

时间:2016-08-26 10:23:45      阅读:387      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!