Web front-end Development Basics lesson three (interacting with the browser)

Source: Internet
Author: User

Grammar:

<form   method= "transfer mode"   action= "Server file" >

Explain:

1.<form>:<form> tag is in pairs, to <form> start, to </form> end.

2.Action : where the data entered by the browser is transmitted, such as a PHP page (save.php).

3.method : The way data is transmitted (Get/post).

<form    method= "POST"   action= "save.php">        <label for= "username" > User name: </label >        <input type= "text" name= "username"/>        <label for= "pass" > Password:</label>        < Input type= "password" name= "pass"/></form>

Attention:

1. All form controls (text boxes, text fields, buttons, radio boxes, checkboxes, and so on) must be placed between the <form></form> tags (otherwise the user input information can not be submitted to the server Oh!). )。

2, Method:post/get the difference this part of the content belongs to the back-end programmer to consider the problem.

Text input box, password entry box

A text input box is used when the user wants to type something like letters, numbers, and so on in the form. The text box can also be converted into a password entry box .

Syntax :

<form>   <input type= "Text/password" name= "name" value= "text"/></form>

1、type:

   当type="text"时,输入框为文本Input box;

   当type="password"时,输入框为密码输入框。

2、name:为文本框命名,以备后台程序ASP 、PHP使用。

3、value:为文本输入框设置默认值。(一般起到提示作用)

举例

<form>  Name:  <input type= "text" name= "MyName" >  <br/>  Password:  <input type= " Password "name=" pass "></form>

Results displayed in the browser:

Web front-end Development Basics lesson three (interacting with the browser)

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.