How to add a button as an option in select tag | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to add a button as an option in select tag

I want to add a button as an option in the select field but I Don't really know how need help and maybe tell me to search somewhere else then stackoverflow or w3school thx anyway

19th Jul 2017, 6:43 AM
Victor Cislari
Victor Cislari - avatar
7 Answers
0
Can you explain what you want a little more? What "select field" is this?
19th Jul 2017, 8:40 AM
James
James - avatar
0
Well you know those select tags and with the options
19th Jul 2017, 8:41 AM
Victor Cislari
Victor Cislari - avatar
0
You can't put a functional button in place of one of the options. The select and option tags create special fields, which you can format in css but not add buttons inside. Why is it you want a button? Perhaps there is a better way to do it. If you really did want a button, you could create your own select-like combination of elements using divs and a heap of javascript. This would be quite painful...
19th Jul 2017, 8:44 AM
James
James - avatar
0
Oh thank you I'll try to find a way around
19th Jul 2017, 8:46 AM
Victor Cislari
Victor Cislari - avatar
0
Btw I just wanted to display not options by clicking on button with should be located in the select as an oprion
19th Jul 2017, 8:46 AM
Victor Cislari
Victor Cislari - avatar
0
You mean the button makes the options appear?
19th Jul 2017, 9:17 AM
James
James - avatar
0
yeah that it does anyway
23rd Jul 2017, 8:54 AM
Victor Cislari
Victor Cislari - avatar