Add input button num select

2

I want a button to call another page inside a select. The problem is that using this code, the button is always outside the select.

<select>
  <option>teste</option>
  <option><input type=button value="Teste2"/></option>
</select>  

Example: link

    
asked by anonymous 09.02.2015 / 17:50

2 answers

3

<option> elements do not accept HTML, text only. If you want to create a dropdown with visually more sophisticated options, you'll need to simulate your own <select> using other HTML elements plus JavaScript.

Maybe this jQuery plugin will solve for you: link

    
09.02.2015 / 17:52
0

It is not possible to add a <button> within a select natively. You get this result with javascript by simulating a select.

    
11.04.2015 / 15:05