Today, I want to learn the basic knowledge of form elements.
Go directlyCode:
<HTML>
<Head> <title> test form </title> <Body>
<! -- The value of action is the submitted page (URL) -->
<! -- Method specifies the method for data submission. Two methods are commonly used: Get/Post -->
<Form action = "#" method = "Post">
Username: <input type = "text" name = "username" size = "20"/> <br/>
Password & nbsp; Code: <input type = "password" name = "password" size = "20"/> <br/>
Your Homepage Address: <input type = "text" name = "website" value = "http: //"/> <br/>
<P> set the size and maxlength values </P>
<Input type = "text" name = "name01" size = "40"/> <br/>
<Input type = "text" name = "name02" maxlength = "5"/> <br/>
<HR/>
<P> check box and single button </P>
<Input type = "checkbox" name = "banana"> banana <br/>
<Input type = "checkbox" name = "apple"> Apple <br/>
<Input type = "checkbox" name = "orange"> orange <p>
<! -- Note: The name attribute in a single queue must be the same for the display effect -->
<Input type = "radio" name = "Fruit"> banana <br/>
<Input type = "radio" name = "fruit" Checked> Apple <br/>
<Input type = "radio" name = "Fruit"> orange <br/>
<P> image coordinates </P>
<Input type = "image" name = "face" src = "f.png"/> <p>
<Input type = radio name = zoom value = 2 checked> X2
<Input type = radio name = zoom value = 4> X4
<Input type = radio name = zoom value = 6> X6 <p>
<P> hide a form </P>
<Input type = "hidden" name = "hiddenform"> here is a hidden element. <p>
<P> list box </P>
<! -- Select attribute: Size, multiple (Multiple choices -- Note: Use the ctrl key with the mouse to achieve multiple selections) -->
<Select name = "Fruits" size = "3" multiple>
<Option> banana
<Option selected> Apple
<Option value = "my_favorite"/> orange
<Option> peach
</SELECT> <p>
<P> text area </P>
<Textarea name = "comment" rows = "5" Cols = "60">
</Textarea> <p>
<Input type = "Submit" value = "login">
<Input type = "reset" value = "re-fill">
</Form>
</Body>
</Html>