Home  >  Article  >  Web Front-end  >  Comprehensive understanding of HTML Form form elements

Comprehensive understanding of HTML Form form elements

高洛峰
高洛峰Original
2017-02-10 10:33:34898browse

The following editor will bring you a comprehensive understanding of HTML Form form elements. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

is as follows:


XML/ HTML CodeCopy content to clipboard

  1. ##>
  2. ##<

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

  3. <

    head>

  4. <

    title>Registration formtitle >

  5. #

    head> <

  6. body> ##<

  7. form

    action="DoFormAction.htm">                   < fieldset

    style
  8. =
  9. "width=800px"

    >                                                                                                                                           Border-->                                                                                                                                  Registerlegend> ##                                                          ##cellspacing=

  10. "0px"

    cellpadding="6px" border="1px" bordercolor="black"

    align
  11. =
  12. "center"

    width="600px "> ##                                                                                                                                                                                  Name:td>                                                                                                  

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

  14.             tr>  

  15.             <tr>  

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

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

  18.             tr>  

  19.             <tr>  

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

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

  22.             tr>  

  23.             <tr>  

  24.                                                                                                                                              :td>                                                                           ##                                                                                                                                                  #input type="radio" checked="checked" name=

    "sex1"
  25. value

    ="Male" />Male                                       input

  26. type
  27. =

    "radio" name="sex1" value="女" />##                                                ##>                                                                       ##                                                                                                                                                  #td align="right">

    Gender (you can click on the text to select):
  28. td>                                                                            ## & LT; FieldSet STYLE = "Width: 150px" ## & GT # & lt;!-Form frame, you can also set the width through CSS-& gt; ## & lt

  29. >

    Please select your genderlegend>

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

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

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

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

  34.                     fieldset>  

  35.                 td>  

  36.             tr>  

  37.             <tr>  

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

  39.                 <td>  

  40.                     <select name="city">  

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

  42. ## & lt; Option ##Value = "Shenzhen" & GT option>

  43.                                          
  44. #value

    ="Shanghai">上海option> ##                       <option

  45. value
  46. =

    "Nanchang" selected="selected">Nanchangoption> < !--Nanchang is selected by default-->                                                    ##                                                                                                                       

  47. tr
  48. > ##                                          #>

  49. ##                                                                                                        
  50. >

    City area:td>

  51. ##                      #<

    td> ##                                               #name

  52. =
  53. "area"

    >                                                                                                                                                              label="Beijing"

    >
  54.                                                                                
  55.                   <option value="Chaoyang District">Chaoyang Districtoption>

  56.                                      <option value="Haidian District"> Haidian Districtoption##>

  57. ##                                              
  58. value="Other areas">Other areasoption >                <optgroup label

    =
  59. "Nanchang"
  60. >                   <

  61. option
  62. value="东湖区">东湖区option>

  63. ##                                                                                ##value="西湖区">西湖区option> ##                                <

    option
  64. value

    ="青山湖区"> ;青山湖区option>                                                                                                #optgroup>

    ##                                                            
  65. #                                                                                                      tr> > ##                                                           

  66. >
  67. Dating goal:

    td>

  68.                                                                                                                                                            through ##select name="target"

    size
  69. =
  70. "3"

    multiple ="multiple">                                                                                                               <option value="Peer" selected="selected"> ;PEER

  71. option
  72. > ##                                                                                                        ##option value="Ordinary friends">Ordinary friendsoption > ##                                                                              

    ##>
  73. 爱人
  74. option> ##                          select> ##                                                 ##>                                                                       ##                                                                                                                                                  #td
  75. align

    ="right">Hobbies:td> ##                                                                                                                                                                                                          

  76.                                                                                                                                                 through ##"love" value="Football" />Football # <input type="checkbox" name

    =
  77. "love"
  78. value ="Blue Ball" />Blue Ball               <input type="checkbox" name

    =
  79. "love"
  80. value="Table tennis " />Table Tennis              td> ##                                                                                  ##<

  81. tr
  82. > ##                                                        ##align="right"

  83. >
  84. Photo upload:

    td>

  85. ##                                                                                 
  86.                                                          ="file" name="myPic"

    />
  87. td>                                         >                                                                        

  88.                                                                                                                                                 Introduction:td> ##                                             

    ##         
  89. <
  90. textarea rows="5" cols

    =
  91. "50"
  92. > ##                                                               

  93.                                                                                                                                   /tr>                                                                     ;                                                                                              #colspan="2"

    >
  94.                                      type="submit"

    value
  95. =
  96. "OK"

    />               

    <
  97. input

    type="reset" value=

    "clear " #"image"
  98. src

    ="../images/btnreg.png" onclick="alert('hello')"

    />
  99.