Answers for "how to make a select required in html"

16

html select required

<select name="color" id="color" required>
	<option value="" selected disabled hidden>Choose color...</option>
    <option value="R">Red</option>
    <option value="B">Blue</option>
</select>
Posted by: Guest on April-13-2021
0

select required

<label for="cars">Choose a car:</label>

<select name="cars" id="cars" required>
  <option value="">None</option>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
Posted by: Guest on October-29-2021

Code answers related to "how to make a select required in html"

Browse Popular Code Answers by Language