当前位置:软件学堂 > 资讯首页 > 网络编程 > DIV+CSS > 表单中的重置按钮reset

表单中的重置按钮reset

2012/11/21 19:16:23作者:佚名来源:网络

移动端

【实例介绍】

表单中的重置按钮reset

重置按钮可以清除用户在页面中输入的信息,将其恢复成默认的表单内容。

【基本语法】

<input  type="reset"  name="按钮的名称"  value="按钮的取值"/>

【语法介绍】

在该语法中,value同样用来设置显示在按钮上的文字。

【实例代码】

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>重置按钮</title> </head> <body> <table width="100%" cellspacing="0" cellpadding="0">   <tr>     <td><form action="mailto:weixiaofoxw.com" name="form1" method="post" enctype="application/x-www-form-urlencoded"target="_blank" >       <p>用户名                          :            <input name="textfield" type="text" size="20" maxlength="15" />       </p>       <p>密码:                 <input name="textfield2" type="password" value="abcdef" size="25" maxlength="6" />       </p>       <p>性别 :         <input name="radiobutton" type="radio" value="radiobutton" checked="checked" /> 男 <input type="radio" name="radiobutton" value="radiobutton" /> 女 </p>       <p>         <input type="submit" name="button" value="提交">         <input type="reset" name="button2" value="重置">       </p>     </form></td>   </tr> </table> </body> </html>

【代码分析】

在代码中,加粗部分的<input type="reset"name="button2"value="重置">标记将按钮的类型设置为reset,取值设置为“重置”,在浏览器中浏览效果,如图所示。

重置按钮reset运行效果

 【素材及源码下载】

请点击:重置按钮reset 下载本实例相关素材及源码

 

标签: 表单