大小为 1 的多选下拉菜单

发布于 2024-08-13 19:12:45 字数 139 浏览 2 评论 0原文

有什么方法可以创建大小为 1 的组合框 (

Is there any way of creating a combo box (<select>) with a size of 1? All the examples I can find allow for multiple selects but with a number of options visible at any one time. If this cannot be accomplished with bog standard HTML is it possible in a JS library such as JQuery?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小鸟爱天空丶 2024-08-20 19:12:45

编辑:我的帖子没有回答问题,但评论可能会澄清问题。

您想要的是将属性 size 设置为 1,即:

<select size="1" name="...">
    <option value="...">...</option>
    ...
</select>

EDIT: My post does not answer the question, but the comments might clarify the question.

What you want is to set the attribute size to 1, i.e.:

<select size="1" name="...">
    <option value="...">...</option>
    ...
</select>
梦里泪两行 2024-08-20 19:12:45

我担心这将是可用性的噩梦。您想要实现的更总体目标是什么?我确信已经存在更好的解决方案。

我猜你需要类似标签编辑器小部件之类的东西。

I'm afraid that would be usability nightmare. What is the more general goal you are trying to achieve? I'm sure better solutions already exist.

I could guess you need something like tag editor widget.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文