Select Tag (<select> </select>)

Example : How to create a Combo box/Drop down list in a html web page.

<!doctype html>  
<html>	
   <head>
      <title>Codershelpline Code of Typical Html Page</title>
   </head>
	
   <body>
      <form name="form1" id="form2" action="#" method="post">
	 <center>
	    <fieldset style="width: 600px">				
		<legend>Create New Student Account</legend>
		   <table name="tab1" id="tab2">			   
		      <tr>
			    <td>Security Questions</td>
			    <td>:</td>
			    <td>
   				<select name="CmbSecQues1" id="CmbSecQues2">
       				   <option value="Choose One">Choose One</option>
       				   <option value="What is Your Favourite Book">What is Your Favourite 
                                       Book</option>
       				   <option value="What is Your Favourite Teacher">What is Your 
                                       Favourite Teacher</option>
       				   <option value="What is Your Favourate Place">What is Your 
                                       Favourate Place</option> 
       				   <option value="What is Your Favourate Pets">What is Your Favourate 
                                       Pets</option>
   				</select>
			     </td>
		     </tr>			   
		     
		    <tr>
			     <td></td>
			     <td></td>
			     <td><input type="submit" name="BtnSave1" id="BtnSave2" value="Save">
			     	 <input type="reset" name="BtnReset1" id="BtnReset2" value="Reset">                                 
			     </td>
		     </tr>
		   </table>
	       </fieldset>
            </center>
	 </form>
      </body>
  </html>

Example : How to increase the length/witdh of the Combo box.

<!doctype html>  
<html>	
   <head>
      <title>Codershelpline Code of Typical Html Page</title>
   </head>
	
   <body>
      <form name="form1" id="form2" action="#" method="post">
	 <center>
	    <fieldset style="width: 600px">				
		<legend>Create New Student Account</legend>
		   <table name="tab1" id="tab2">			   
		      <tr>
			    <td>Security Questions</td>
			    <td>:</td>
			    <td>
   				<select name="CmbSecQues1" id="CmbSecQues2" style="width: 300px">
       				   <option value="Choose One">Choose One</option>
       				   <option value="What is Your Favourite Book">What is Your Favourite 
                                       Book</option>
       				   <option value="What is Your Favourite Teacher">What is Your 
                                       Favourite Teacher</option>
       				   <option value="What is Your Favourate Place">What is Your 
                                       Favourate Place</option> 
       				   <option value="What is Your Favourate Pets">What is Your Favourate 
                                       Pets</option>
   				</select>
			     </td>
		     </tr>			   
		     
		    <tr>
			     <td></td>
			     <td></td>
			     <td><input type="submit" name="BtnSave1" id="BtnSave2" value="Save">
			     	 <input type="reset" name="BtnReset1" id="BtnReset2" value="Reset">                                 
			     </td>
		     </tr>
		   </table>
	       </fieldset>
            </center>
	 </form>
      </body>
  </html>

Loading

Categories: HTML

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.