03-HTML form

1, input form input elements, type attributes, <input type = "">

text: Text domain 
password: password Domain file: file domain checkbox: check domain radio: radio domain button: button to submit: Submit button reset: reset button hidden: hidden field image: image domain

 

2, radio buttons (radio)

< Form > 
NaN3 < INPUT type = "Radio" name = "Sex" value = "man" >  // value is not displayed, but will be sent to the server 
NV < INPUT type = "Radio" name = "Sex" value = "Woman " >  // radio button name value must be the same as 
bm < the INPUT of the type =" radio " name =" Sex " value =" bm " the checked >  // start the checked value is selected
 </ form >

 

form tag, add form elements to achieve

input: Input Form label 

select: drop-down menu list and label 

option: drop-down menu and list items grouping label 

optgroup: drop-down menu and list items into the tag 

textarea: Text field labels

 

3, checkboxes

< Form > 
Dushu < INPUT type = "CheckBox" name = ". 1" value = " Dushu" >  // value is not displayed, but will be sent to the server 
Changge < INPUT type = "CheckBox" name = "2" value = " Changge " >    // value can name the same, may be different 
tiaowu < INPUT type =" CheckBox " name =". 3 "value =" tiaowu "the checked >  // start the checked value is selected
 </ form >

 

4, image domain

< Form > 
< the INPUT of the type = "Image" name = "4" src = " #" >  // src image domain is essential. Using the image field corresponds to submit button
 </ form >

 

5, hidden fields, target is the link to open the way, _blank opens a new page link

< Form target = "_ blank" > 
< the INPUT of the type = "hidden" name = "" >  // hide the content submitted
 </ form >

 

6, option drop-down menu, you can select only a

< The SELECT name = "" > 
< the Option value = "" the Selected > - Please select - </ the Option >  // the Selected default state
 < the Option value = "" > Option 2 </ the Option > 
< the Option value = "" > Options three </ Option > 
</ SELECT >

 

select tag attributes

name: the drop down list names and list 

multiple: providing a plurality of selectable options for 

setting the number of visible in the list of options: size

 

7, a display 3, according to ctrl multiple choice

<select name="" size="3″ multiple>
<option value="">选项一</option>
<option value="">选项二</option>
<option value="">选项三</option>
</select>

 

8, the pull-down menu packet

< The SELECT > < optgroup label = "Group 1"> // optgroup of options are grouped, label the group name 
<the Option value = " " the Selected > Option 1 </ the Option > // the Selected default state
 < the Option value = "" > option 2 </ option > 
< option value = "" > option 3 </ option > 
</ optgroup > 

< optgroup label = "group 2"> <option value = " " >Option 1 </ the Option > <option value="">选项二</option> <option value="">选项三</option> </optgroup> </select>

 

9, textarea character region

< TextArea name = "" rows = ". 5" cols = " 50" placeholder = "Please enter .." >  // is the number of rows of text fields, cols is the width of the text field
 </ TextArea >   // text placeholder message field

 

10, span tags: no real meaning, just to apply styles

< Span >   span tag is a tag within the row, the contents of which are added are displayed in a row  </ span >

 

11, div block-level tags: inline label may comprise, but may not contain the block-level row label tag.

< Div >   div tag is a block-level tag, a div per line  </ div >

Guess you like

Origin www.cnblogs.com/mingliangge/p/12207594.html