Home  >  Article  >  Web Front-end  >  How to include an option in a dropdown list in HTML?

How to include an option in a dropdown list in HTML?

WBOY
WBOYforward
2023-09-07 11:29:04937browse

How to include an option in a dropdown list in HTML?

To include options in a drop-down list, use the

HTML

Attributes

Value

Description

th>

Disabled

Disabled

Disable input controls. The button will not accept changes from the user. It also fails to receive focus and is skipped on tabbing.

Tag

Text

define when using tags to use.

Selected

Selected

When the definition page loads The default option to select.

Value

Text

Specifies options to send to the server Value

Example

You can try running the following code to implement the

<!DOCTYPE html>
<html>
   <head>
      <title>HTML option Tag</title>
   </head>
   <body>
      <form action = "/cgi-bin/dropdown.cgi" method = "post">
         <select name = "dropdown">
            <option value = "HTML" selected>HTML</option>
            <option value = "Ruby">Ruby</option>
         </select>
         <input type = "submit" value = "Submit" />
      </form>
   </body>
</html>

The above is the detailed content of How to include an option in a dropdown list in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete