Web Beginner Notes 3-html practical elements 3

Source: Internet
Author: User

html-check box

<body>

<form>
I like bikes:
<input type= "checkbox" Name= "Bike" >
<br/>
I like cars:
<input type= "checkbox" Name= "Car" >
</form>

</body>

Show Results:

html-Radio Box

<body>

<form>
Men:
<input type= "Radio" checked= "Checked" name= "Sex" value= "male"/>
<br/>
Women:
<input type= "Radio" name= "Sex" value= "female"/>
</form>

<p> when a user taps a radio button, the button becomes selected and all other buttons become unchecked. </p>

</body>

Show Results:


html-drop-down list 1

<body>

<form>
<select name= "Cars" >
<option value= "Volvo" >Volvo</option>
<option value= "Saab" >Saab</option>
<option value= "Fiat" >Fiat</option>
<option value= "Audi" >Audi</option>
</select>
</form>

</body>

Show Results:


html-drop-down list 2

<body>

<form>
<select name= "Cars" >
<option value= "Volvo" >Volvo</option>
<option value= "Saab" >Saab</option>
<option value= "Fiat" Selected= "selected" >Fiat</option>
<option value= "Audi" >Audi</option>
</select>
</form>

</body>

Show Results:


html-text fields
<body>

<p>
This example cannot is edited
Because our editor uses a textarea
For input,
And your browser does not allow
A textarea inside a textarea.
</p>

<textarea rows= "Ten" cols= ">"
The cat is playing in the garden.

Show Results:


html-button

<body>

<form>
<input type= "button" value= "Hello world!" >
</form>

</body>

Show Results:


Html-fieldset around data
<! DOCTYPE html>

<body>

<form>
<fieldset>
<legend> Health Information </legend>
Height: <input type= "text"/>
Weight: <input type= "text"/>
</fieldset>
</form>

<p> if there is no border around the form, your browser is too old. </p>

</body>

Show Results:

html-a form with an input box and a confirmation button
<body>

<form action= "/example/html/form_action.asp" method= "Get" >
<p>first Name: <input type= "text" name= "FName"/></p>
<p>last Name: <input type= "text" name= "lname"/></p>
<input type= "Submit" value= "Submit"/>
</form>

<p> Click the Confirm button to enter a page that will be sent to the server named "Form_action.asp". </p>

</body>

Show Results:


html-a form with a check box

<body>

<form name= "Input" action= "/html/html_form_action.asp" method= "Get" >
I have a bike:
<input type= "checkbox" name= "vehicle" value= "Bike" checked= "checked"/>
<br/>
I have a car:
<input type= "checkbox" name= "vehicle" value= "Car"/>
<br/>
I have an airplane:
<input type= "checkbox" name= "vehicle" value= "airplane"/>
<br/><br/>
<input type= "Submit" value= "Submit"/>
</form>

<p> If you click on the "Submit" button, you will transfer the input to a new page called html_form_action.asp. </p>

</body>

Show Results:

html-a form with radio buttons

<body>

<form name= "Input" action= "/html/html_form_action.asp" method= "Get" >
Male:
<input type= "Radio" name= "Sex" value= "Male" checked= "Checked" >
<br/>
Female:
<input type= "Radio" name= "Sex" value= "Female" >
<br/>
<input type = "submit" value = "Submit" >
</form>

<p> If you click on the "Submit" button, you will transfer the input to a new page called html_form_action.asp. </p>

</body>

Show Results:


html-sending e-mail from forms

<body>
<form action= "Mailto:[email protected]" method= "POST" enctype= "Text/plain" >

Name: <br/>
<input type= "text" name= "name" value= "yourname" size= ">"
<br/>
E-mail: <br/>
<input type= "text" name= "Mail" value= "Yourmail" size= ">"
<br/>
Content: <br/>
<input type= "text" name= "comment" value= "yourcomment" size= ">"
<br/><br/>
<input type= "Submit" value= "Send" >
<input type= "reset" value= "reset" >

</form>
</body>

Show Results:

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.