Drop Down List in Html


This is the simple HTML code to make a drop down list in html. To create a down list in html we use <select> tag and for elements that are in Drop down list we use <option> tag.


  Source Code 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

 <title>  Drop Down list </title>
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
<h1> Drop Down List </h1>
  <label> Country: </label>
   <select name = "myCountryName" >
    <option value= "USA"> USA </option>
    <option value= "Pakistan"> Pakistan </option>
    <option value= "India"> India </option>
    <option value= "Canada"> Canada </option>
    <option value= "France"> France </option>
    <option value= "Germany"> Germany </option>
    <option value= "Italy"> Italy </option>
    <option value= "Iran"> Iran </option>
    <option value= "UK"> UK </option>
    <option value= "Nepal"> Nepal </option>
    <option value= "Other"> Other </option>
   </select>
</body>
</html>

Output of the Program 


Drop Down list in html
Drop Down list in html

Share on Google Plus

About Asad

Asad Niazi is Software Engineer , Programmer, Web Developer and a young mentor of BloggersTown and PProgramming. Asad Love to writes about Technology, Programming, Blogging and make money online.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment