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.
.<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:
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)
<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
<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!