How to create a drop-down list in html?

Asked

Viewed 5,458 times

-3

inserir a descrição da imagem aqui

Can you create something like this with html? Or what is best used to create?

  • Your difficulty is creating a combobox with HTML?

  • I didn’t really know about this command.

  • I wanted to create something similar to the img thing, and I looked but I found nothing on google .

2 answers

2


You’re looking for the tag select. one of the names of this element is dropdown.

<select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
</select> 

  • opa mano o cara me passou o combobox também qual você aconselha neste caso?

  • Combo box, combo box, drop-down, dropdown. all are the same thing. The HTML implementation is the <select>

  • Dropdown is a definition of UI Design... not an alias or "other name" for the tag <select> and is not part of the HTML specification. I would recommend removing the snippet that alludes to "another name"

  • Yes, but all terms represent the same element for the system user. I didn’t say it’s an alias, but the HTML implementation of this element is via select.

  • Thanks a lot bro, Could you get me just one more question? type I want to make two boxes of them side by side one for example: can be pizza 1 and the other would be soda ( only an Exp) and then selecting an opition of each generate a button with the value, I would need php or da to do only with html?

  • I recommend reading some tutorial on HTML forms. You create a form and within it several elements, one of them is called Submit. Submit, sends the value of all elements within the form.

Show 1 more comment

-1

....you can also provide the html element "select" for the user to make multiple selections of "options", declaring it as follows: . Note the attribute "Multiple".

...thus select, from more than 1 "option", the user must hold down the "Ctrl" key while making selections of more than 1 "option".

However, I advise, in case the user has to select multiple "options", the use of the html element of type "checkbox", since this element has no restriction regarding the Operating System, While Select with multiple attribute on MAC the key you should hold while making the mouse selection is not the same CTRL key used on Windows or LINUX. In Linux is also used the CTRL key, but in MAC is not.

Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.