HTML – select list

Previous
Next

Creating a selection list:

  • A selection list comes in handy when you have many choices to display within a limited space.
  • A selection list also is a convenient way to get fixed set of possible choices to prevent any invalid input or spelling mistakes.
  • A selection list starts with the <select> tag and ends with the corresponding closing tag:
    • </select>. Each option or choice for your selection list is listed with the <option> tag.
    • The <option> tag also is a two-sided tag, meaning you should close this tag with </option>.
Select your favorite web site:
	<select>
		<option>https://demo.fullstackedutech.com</option>
		<option>https://www.google.com</option>
		<option>https://www.msn.com</option>
	</select>

Name attribute:

            By adding the name attribute to the selection list, you use that name to find out what the user selected when the form is submitted. When a user submits a choice for a selection list, the value you assigned, if any, to the <option> tag is submitted to the server.

Select your favorite web site:
	<select name="FavWebSite">
		<option value="learnonline">https://demo.fullstackedutech.com</option>
		<option value="Google">https://www.google.com</option>
		<option value="MSN">https://www.msn.com</option>
	</select>
Previous
Next

Courses Enquiry Form