Home > Article > Web Front-end > HTML interaction
The content of this article is about the interaction of HTML, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
1. How does the website interact with users? The answer is to use HTML forms. The form can transmit the data entered by the viewer to the server, so that the server-side program can process the data passed by the form. 6a1e950fefb0a2880e91a72d2551df21
1).ff9c23ada1bcecdd1a0fb5d5a0f18437: ff9c23ada1bcecdd1a0fb5d5a0f18437 tags appear in pairs, starting with ff9c23ada1bcecdd1a0fb5d5a0f18437 Start with f5a47148e367a6035fd7a2faa965022e.
2).action: The place where the data entered by the viewer is sent, such as a PHP page (save.php).
3).method: The method of data transmission (get/post).
Example: method="post" action="save.php"
2. When the user wants to type letters and numbers in the form When waiting for content, the text input box will be used. The text box can also be converted into a password input box.
<form> <input type="text/password" name="名称" value="文本" /> </form>
1)type:
When type="text", the input box is a text input box;
When type= When "password" is used, the input box is the password input box.
2) name: Name the text box for use by the background programs ASP and PHP.
3)value: Set the default value for the text input box. (Generally used as a prompt)
Example: 09b69c7aa013e7537e15044b9199ac53
7584d201bd587e7cc9188d10ec66500e
3. When the user needs to enter a large section of text in the form, a text input field needs to be used.
<textarea rows="行数" cols="列数">文本</textarea>
1)4750256ae76b6b9d804861d8f69e79d3 tags appear in pairs, starting with 4750256ae76b6b9d804861d8f69e79d3 and ending with 40587128eee8df8f03d0b607fe983014.
2)cols: The number of columns in the multi-line input field.
3)rows: The number of rows in the multi-line input field.
4) Default values can be entered between the 4750256ae76b6b9d804861d8f69e79d340587128eee8df8f03d0b607fe983014 tags.
Example:
<textarea cols="50" rows="10">在这里输入内容...</textarea>
4. Use radio buttons and check boxes to let users choose
<input type="radio/checkbox" value="值" name="名称" checked="checked"/>
1)type:
When type="radio", the control is a radio button
When type="checkbox", the control is a check box
2 )value: The value of submitting data to the server (used by background program PHP)
3) name: Name the control for use by background programs ASP and PHP
4 )checked: When setting checked="checked", this option is selected by default
For radio buttons in the same group, the name value must be consistent, and the value can be inconsistent. For example, the above example has the same name. "radioLove", so that the radio buttons in the same group can play the role of radio selection
5. Use the drop-down list box to save space
<option value="提交值">选项</option> 设置selected="selected"属性,则该选项就被默认选中。
6. The drop-down list can also perform multiple selection operations. Set the multiple="multiple" attribute in the 221f08282418e2996498697df914ce4e tag to realize the multiple selection function. Under the Windows operating system, press the Ctrl key while performing multiple selections. Click (Command click on Mac) to select multiple options.
Example:
<select multiple="multiple">
7. When users need to submit form information to the server, they need to use the submit button.
<input type="submit" value="提交">
type: Only when the type value is set to submit, the button can submit
value: The text displayed on the button
8. You can use the reset button to restore the input box to its initial state. Just set type to "reset".
<input type="reset" value="重置">
##9. The label label does not present any special effects to the user, its role is to improve usability for mouse users. This control will be triggered if you click on the text inside the label. That is to say, when the user clicks to select the label, the browser will automatically turn the focus to the form control related to the label (it will automatically select the form control related to the label). The value in the for attribute of the
tag must be the same as the id attribute value of the related control.
The function of label is that clicking on the word "male" is equivalent to clicking on the dot behind "male"
html Image tag META Tag inline frame hyperlink
The above is the detailed content of HTML interaction. For more information, please follow other related articles on the PHP Chinese website!