HTML Form表单元素全面了解

高洛峰
发布: 2017-02-10 10:33:34
原创
956 人浏览过

下面小编就为大家带来一篇HTML Form表单元素全面了解。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧

如下所示:


XML/HTML Code复制内容到剪贴板

  1. >  

  2.   

  3. <html xmlns="http://www.w3.org/1999/xhtml">  

  4. <head>  

  5.     <title>注册表单title>  

  6. head>  

  7. <body>  

  8.     <form action="DoFormAction.htm">  

  9.         <fieldset style="width=800px">                                                                

  10.         <legend>请输入如下的信息然后进行注册legend>  

  11.         <table cellspacing="0px" cellpadding="6px" border="1px" bordercolor="black" align="center" width="600px">  

  12.             <tr>  

  13.                 <td align="right">用户名:td>                                     

  14.                 <td><input type="text" size="20" style="width:150px" />td>  

  15.             tr>  

  16.             <tr>  

  17.                 <td align="right">密码:td>                                       

  18.                 <td><input type="password" size="20" style="width:150px" />td>  

  19.             tr>  

  20.             <tr>  

  21.                 <td align="right">确认密码:td>  

  22.                 <td><input type="password" size="20" style="width:150px" />td>  

  23.             tr>  

  24.             <tr>  

  25.                 <td align="right">性别:td>                                        

  26.                 <td>  

  27.                     <input type="radio" checked="checked" name="sex1" value="男" />男    

  28.                     <input type="radio" name="sex1" value="女" />女   

  29.                 td>  

  30.             tr>  

  31.             <tr>  

  32.                 <td align="right">性别(可以点文字选择):td>  

  33.                 <td>  

  34.                     <fieldset style="width:150px">                                

  35.                     <legend>请选择性别legend>  

  36.                         <input type="radio" checked="checked" name="sex2" value="男" id="man" />  

  37.                         <label for="man">label>  

  38.                         <input type="radio" name="sex2" value="女" id="woman" />  

  39.                         <label for="woman">label>  

  40.                     fieldset>  

  41.                 td>  

  42.             tr>  

  43.             <tr>  

  44.                 <td align="right">城市:td>                                      

  45.                 <td>  

  46.                     <select name="city">  

  47.                         <option value="北京">北京option>  

  48.                         <option value="深圳">深圳option>  

  49.                         <option value="上海">上海option>  

  50.                         <option value="南昌" selected="selected">南昌option>    

  51.                     select>  

  52.                 td>  

  53.             tr>  

  54.             <tr>  

  55.                 <td align="right">城市所在区域:td>  

  56.                 <td>  

  57.                     <select name="area">            

  58.                         <optgroup label="北京">                                  

  59.                             <option value="朝阳区">朝阳区option>  

  60.                             <option value="海淀区">海淀区option>  

  61.                             <option value="其他区">其他区option>  

  62.                         optgroup>  

  63.                         <optgroup label="南昌">  

  64.                             <option value="东湖区">东湖区option>  

  65.                             <option value="西湖区">西湖区option>  

  66.                             <option value="青山湖区">青山湖区option>                               

  67.                         optgroup>  

  68.                     select>  

  69.                 td>  

  70.             tr>  

  71.             <tr>  

  72.                 <td align="right">交友目标:td>  

  73.                 <td>  

  74.                     <select name="target" size="3" multiple="multiple">                 

  75.                         <option value="同行" selected="selected">同行option>  

  76.                         <option value="普通朋友">普通朋友option>  

  77.                         <option value="爱人">爱人option>  

  78.                     select>  

  79.                 td>  

  80.             tr>  

  81.             <tr>  

  82.                 <td align="right">爱好:td>  

  83.                 <td>  

  84.                                                                                   

  85.                     <input type="checkbox" name="love" value="足球" />足球   

  86.                     <input type="checkbox" name="love" value="蓝球" />蓝球   

  87.                     <input type="checkbox" name="love" value="乒乓球" />乒乓球   

  88.                 td>  

  89.             tr>  

  90.             <tr>  

  91.                 <td align="right">照片上传:td>  

  92.                 <td>  

  93.                                                                                   

  94.                     <input type="file" name="myPic" />  

  95.                 td>  

  96.             tr>  

  97.             <tr>  

  98.                 <td align="right">自我介绍:td>  

  99.                 <td>  

  100.                                                                                   

  101.                     <textarea rows="5" cols="50">  

  102.                     textarea>  

  103.                 td>  

  104.             tr>  

  105.             <tr>  

  106.                 <td align="center" colspan="2">  

  107.                     <input type="submit" value="确定" />  

  108.                     <input type="reset" value="清空" />                       

  109.                     <input type="image" src="../images/btnreg.png" onclick="alert('hello')" />        

  110.                 td>  

  111.             tr>  

  112.         table>  

  113.         fieldset>  

  114.     form>  

  115. body>  

  116. html>  

以上就是小编为大家带来的HTML Form表单元素全面了解的全部内容了,希望对大家有所帮助,多多支持PHP中文网~

更多HTML Form表单元素全面了解相关文章请关注PHP中文网!

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板