• Register
190 points
‚óŹ5

Html is a markup language that helps us to create a webpage so, in this tutorial, we will create a dropdown list of all Indian states. If you familiar with HTML then this tutorial very easy for you lets start.

Before creating a down-down list we need to learn some basic of HTML dropdown list elements-

What is the dropdown list in HTML?

If you know some basics of HTML then I remember you that with HTML, we can create a simple dropdown list of items. It is also known as a pull-down list menu.

Here we will use some HTML elements that help us to create a drop-down list menu of Indian States.

The <select> element: It is used to create a drop-down list

The name attribute:  It defines a name for the drop-down list

The Label  <label> tag: It is used for several elements but here we will use only for select element 

Code: 

<!DOCTYPE html>
<html>
<head>
    <title>Indian States</title>
</head>
<body>
    <h3>We have created drop-dwon list of Indian States:</h3>
    <label>Select Your State:</label>
    <select name="states">
                        <option value="">Choose State Name</option>
                        <option value="Andhra Pradesh">Andhra Pradesh</option>   
                        <option value="Assam">Assam</option>   
                        <option value="Bihar">Bihar</option>   
                        <option value="Goa">Goa</option>   
                        <option value="Gujarat">Gujarat</option>   
                        <option value="Haryana">Haryana</option>   
                        <option value="Himachal Pradesh">Himachal Pradesh</option>   
                        <option value="Jammu and Kashmir">Jammu and Kashmir</option>   
                        <option value="Jharkhand">Jharkhand</option>   
                        <option value="Karnataka">Karnataka</option>   
                        <option value="Kerala">KeralaKerala</option>   
                        <option value="Madhya Pradesh">Madhya Pradesh</option>   
                        <option value="Maharashtra">Maharashtra/option>
                        <option value="Manipur">Manipur</option>   
                        <option value="">None</option>   
    </select>
</body>
</html>

Note: We have not listed all states name.