Basic HTML Tutorial: Radio Buttons and Check Buttons in Forms
Radio button
## Syntax format:
Commonly used attributes
- Name: The name of the element
- Value: The value of the element, the value The data will be sent to the server.
- Checked: Which item is selected by default. For example: checked = “checked”
Note: Only one of a set of radio buttons can be selected, but the value of the name must be consistent. For example: name = “sex”
The radio button user cannot enter the content himself, the user can only select, so it must refer to the default value value.
Check box
Common attributes
-
Name: the name of the element
- Value: The value of the element
- Checked: Checked by default. For example: checked = "checked"
You can select multiple check boxes at the same time, or you can select none.
Let’s enrich our first example
用户注册 欢迎注册php.cn
Is there too much content? Let’s continue adding to the next section