The <select > element is a form-control in HTML and is used to create a drop-down list in web pages.The <option > tags inside the <select > element define the available options in that drop-down list.
HTML5 supports form input-attribute required="required" for input-type "text" to check the required input-fields.But its not applicable in case of select field. The following code showing how to make select elements required.
View Demo on : http://jsfiddle.net/88rXX/
<select required>
<option value="">select an option</option>
<option value="value1">Value 1</option>
<option value="value2">Value 2</option>
</select>
View Demo on : http://jsfiddle.net/88rXX/
0 comments:
Post a Comment