首页 > 网页制作 > HTML/Xhtml

HTML Form表单元素全面了解

admin HTML/Xhtml 2022-02-04 23:40:39 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表单元素全面了解的全部内容了,希望对大家有所帮助,多多支持潘少俊衡~

版权声明

本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。
本文地址:/web/HTML/70938.html

留言与评论(共有 0 条评论)
   
验证码:

潘少俊衡

| 桂ICP备2023010378号-4

Powered By EmpireCMS

爱享小站

中德益农

谷姐神农

环亚肥料

使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

感谢潘少俊衡友情技术支持