17. Explain the purpose of the select > tag. Also name any of its two arrributes
Answers
Answered by
1
The <select> element is used to create a drop-down list and is most often used in a form, to collect user input.
Two attributes are
name
id
The name attribute is needed to reference the form data after the form is submitted
Note : If you omit the name attribute, no data from the drop-down list will be submitted
The id attribute is needed to associate the drop-down list with a label.
Additional info
The <option> tags inside the <select> element define the available options in the drop-down list.
Advice: Always add the <label> tag for best accessibility practices.
Similar questions