-->
Showing posts with label select with option. Show all posts
Showing posts with label select with option. Show all posts

HTML page with input list, datalist and option.

If we use it then it will show data in drop down list.Better we can understand from following example.
---------------------------------------------------------------------------------------------------------
<html><!--root tag-->

<head><!--used for meta tag-->
    <title><!--title tag-->
        form with input list
    </title>
</head>

<body><!--is a container-->
    form <br>
    <form><!--opening of form tag-->
        <!--following script is related to datalist-->
        <input list="all language" name="language">
        <!--must start with input tag with list name-->
        <datalist id="all language"><!--it contains id of list. It must be same as it is with list-->
          <option value="Internet Explorer">
          <option value="Firefox">
          <option value="Chrome">
          <option value="Opera">
          <option value="Safari">
        </datalist>
    </form>
</body>

</html>

HTML page to create drop down box with values.

We can take following example to understand this.
--------------------------------------------------------------------------------------------
<html><!--starting tag of html-->
<head><!--used for meta tag-->
<title><!--used for title of page-->
form concept
</title>
</head>
<body><!--is container-->
form <br>
<form><!--form tag-->
<select size="1">
<!--creates a box of size 1-->
<option>teacher</option>
<option>student</option>
<option>Parents</option>
<!-- it pust the list in that created box-->

</select><!--closing of select-->
</form>
</body>
</html>