The form is the data entry for the browser to communicate with the server. The form in the browser containsWebsite constructionA form attribute area. Form attributes are attributes that allow users to enter various types of information in a form (such as text boxes, password boxes, drop-down lists, radio buttons, check boxes, etc.).
Forms are defined with<form>. For example, the following code defines a text box form:
Save the above code as "form. htm" and open it in a browser, as shown in Figure 1.10. The form itself is not visible.In addition, in most browsers, the default width of the text box is 20 characters.
The most commonly used form tag is<input>.The type of Input is specified with the type attribute.The most common input types are explained below.
1. Radio button
Save the above code as "radio. htm", open it with a browser, and the result is as shown in Figure 1.11. Radio button refers to multiple selection boxes, but only one of them can be selected.
2. Check box Save the above code as "checkbox. htm", open it with a browser, and the result is shown in Figure 1.12. The check box indicates that multiple codes can be selected. 3. Password box Save the above code as "password. htm" and open it with a browser, as shown in Figure 1.13. 4. Drop down list
Save the above code as "select. htm" and open it with a browser, as shown in Figure 1.14.
5. Pre selected drop-down list Save the above code as "selected. htm" and open it with a browser, as shown in Figure 1.15. Adding "selected" in option means that the top is selected in advance, so that the item is selected by default in the drop-down list.
6. Text Field Save the above code as "textarea. htm" and open it with browsing material. The result is shown in Figure 1.16.The rows attribute refers to the number of lines, and the cols attribute refers to the number of words displayed in a line. 7. Buttons Save the above code as "submit. htm" and open it with a browser, as shown in Figure 1.17.The normal button can be used anywhere, and the submit button is only used for form submission.