html checkbox
时间: 2023-09-01 13:11:28 浏览: 85
html-checkbox
HTML checkbox is a form element that allows users to select one or more options from a list of choices. It is represented by an empty square box that can be checked or unchecked by the user. The checkbox is defined using the input element with type attribute set to "checkbox".
Example of HTML checkbox code:
```
<input type="checkbox" name="fruit" value="apple"> Apple
<input type="checkbox" name="fruit" value="banana"> Banana
<input type="checkbox" name="fruit" value="orange"> Orange
```
In the example above, there are three checkboxes with the same name "fruit" and different values "apple", "banana", and "orange". The user can select one or more fruits by checking the corresponding checkboxes. The values of the selected checkboxes can be submitted to the server for processing.
阅读全文