HTML Page Structure

HTML Elements
HTML Attributes


HTML Select Tag

The <select> tag is used to make a drop-down list. We can list out the available alternatives in the drop down list under the <option> tag.

Syntax

<form>
	<select id="abc"><br />
          <option>1</option>
          <option>2</option>
          <option selected>3</option>
       </select>
</form>

Example

<!DOCTYPE html>
<html>
<head>
<title>My HTML Form Example</title>
</head>
<body>
<form action="mailto:your email" method="get" enctype="text/plain">
      <p>
        Name: <input type="text" id="name" size="25">
     </p>
      <p>
        Please rate hotel service from 1 to 3 (1 = worst and 3= excellent): <br />
       <select id="service rating"><br />
          <option>1</option>
          <option>2</option>
          <option selected>3</option>
       </select>
      </p>
</body>
</html>

This will produce following result

Please rate hotel service from 1 to 3 (1 = worst and 3= excellent):