HTML-form Learning

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.