Javatpoint Logo
Javatpoint Logo

Combobox HTML

We will discuss the Combobox HTML in this article. The name "Combobox" itself contains the word "combo" which means combination. So, from its name, a combobox is a combination of boxes. In HTML, it is the element that we can construct with a combination of tags such as <select> tag and <option> tag. It is mostly utilized inside forms in HTML. It is utilized to construct the dropdown list.

Combobox HTML Syntax:

There are many tags in the above syntax that are defined below:

  • The <label for="name"> tag is utilized to provide the name of the element. This tag uses the "for" attribute that provides more accessibility.
  • The <input type="text"> tag is utilized to define the single-line text field where the user can input.
  • The <select> tag is utilized to make a dropdown list.
  • The <option> tag is utilized inside the <select> tag to define the options in a list.

Demonstrations of Combobox

Let us comprehend how to create a combobox in HTML with the help of demonstrations.

Demonstration 1:

We are constructing a combobox in this demo that displays the full-stack web development languages.

Code:

Output:

Here is the output in which we can witness the combobox that shows full-stack web development languages.

Combobox HTML

Demonstration 2:

We will make a combobox in this demo and give a style to it utilizing CSS.

Code:

Output:

We can witness the combobox in the result provided downwards with some style applied to it.

Combobox HTML

Demonstration 3:

We will construct a combobox under the <form> element. The user has to choose the course from the combobox and submit it.

Code:

Output:

Here is the output provided below, where we can witness a combobox for selecting a course.

Combobox HTML

Demonstration 4:

In this demonstration, we will construct a dropdown list and decorate it using CSS.

Code:

Output:

Here is the output below, in which we can witness a combobox that contains hyperlinks of HTML elements.

Combobox HTML

Demonstration 5:

We will construct a combobox in the student registration form in this demonstration.

Code:

Output:

We can clearly witness a combobox for the "course" in the output below, which is demonstrated inside the student registration form.

Combobox HTML

Demonstration 6:

In this illustration, we will form a "disabled combobox" using an attribute named "disabled".

Code:

Output:

We can witness a "disabled combobox" in the output downwards. When we press on the dropdown list then it will not demonstrate the options because the options have been turned off.

Combobox HTML

Conclusion

We have comprehended the combobox HTML in this article. A combobox is used when there is a need to construct predefined options to choose from. We have understood the combobox with the help of demonstrations.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA