选择下拉菜单(选项、选择) css javascript
I'm currently trying to make a select dropdown (option, select) with a design like the following picture
When selected > 10 then the select dropdown option appears input text to fill in the desired amount.
Has anyone ever made something like this.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你只需为 > 添加一个 if 语句即可10 然后输入显示将从无更改为您想要的任何内容。
I think you'll just add an if statement for > 10 then the input display will change from none to whatever you want.
所请求的下拉列表类型不能仅使用 HTML select 和 option 元素的组合来构造。这是因为 Option 元素 是文本,尽管可以使用 HTML 字符实体。 (如果您在设置选项元素的内容时需要扩展字符引用,请使用其
innerHTML
属性而不是texContent
。)我建议搜索已经可用的 HTML/JavaScript/在开始从头开始编写自己的代码之前,CSS 小部件可以实现类似的目的,无论是独立包还是库插件。
The kind of drop down list requested can not be constructed simply using a combination of HTML select and option elements. This is because the only permitted content type of Option elements is text, although HTML character entities may be used. (If you need to expand character references when setting an option element's content, use its
innerHTML
property instead oftexContent
.)I would suggest searching for an already available HTML/JavaScript/CSS widget fulfilling a similar purpose, whether it be a self contained package or library plugin, before starting to write your own code from scratch.