在 html 的选项标签中包含文本框

Include textbox within option tag in html

我想在我的 HTML 页面中包含一个下拉列表,我也打算在其中允许用户输入。这个问题不同于许多其他关于堆栈溢出的问题,要求完全添加一个选项。

我在下拉列表中有一个技术指标列表。但我需要的是当用户选择简单移动平均线时,he/she 也可以输入所需的 SMA 周期值。但据我搜索,似乎没有办法在选项标签中包含文本框。

我可以使用像 bootstrap/select2 这样的第三方插件。有人知道如何实现吗?

Adding of textbox inside native dropdown box is not possible. but you can add another textbox. when certain value selected you can display that textbox to get data. I just found out a fiddle according to your requirements.

Fiddle link