Home / HTML / Drop down Lists in HTML5

Drop down Lists in HTML5

Create Drop down Lists in HTML5

The drop down lists is another way to give the user the opportunity to choose just one of a series of choices.

Normally the first item in the dropdown list is selected by default.The drop down lists are defined by the <select> element and the values being sent either via email or to the database defined by the value attribute.

Here is a simple example of Dropdown list






If you want another item to be selected instead of the first one on the list, you use the selected attribute.

Form Validation

In a form there are many fields which are used to gather information from the users. While filling then form many times it happens that the visitor gets confused and might skip some important parts of the form, type invalid data also and submit the form. This results in that the form end up getting the more or less useless data.

So to overcome from this problem validation is used means if a user validate the input fields before the data is sent to the inbox or database, then the visitor gets a chance to correct the data which in result the data you actually asked for get improves.