<form><inputtype="checkbox"name="course"value="html"> HTML & CSS<br><inputtype="checkbox"name="course"value="l2c"> Learn to Code<br><inputtype="checkbox"name="course"value="js4w"> JavaScript for Web<br></form>
type=”checkbox”
Attribute for input, creates a checkbox.
name=”...”
Name for the input field group. All checkboxes that belong to the same group should have the same name.
value=”...”
An ID for the item. This value is sent to the program where the data of the form is sent to when the user presses the submit button.
<labelfor="browser">Choose your browser from the list:</label><inputlist="browsers"name="browser"id="browser"><datalistid="browsers"><optionvalue="Edge"><optionvalue="Firefox"><optionvalue="Chrome"><optionvalue="Opera"><optionvalue="Safari"></datalist></form>
To associate a <label> and an <input>, the <input> needs an id attribute. We then assign the for attribute of the label element with the value of the id attribute of <input>:
<formaction="/example.html"method="POST"><labelfor="meal">What do you want to eat?</label><br><input> type="text" name="food" id="meal">
</form>
Every form should define a form action with the action=”...” attribute. The action attribute specifies where to send the form-data when a form is submitted.