将文本字段设为选择框
当我们单击下拉菜单时,我们看不到光标,我们只看到带有值的整个框被选中,我们可以对文本字段执行相同的操作,因为在文本字段中我看到光标闪烁。
如果感到困惑,请参阅图片。 :D
When we click on a dropdown we dont see cursor, we just see the whole box with value gets selected, can we do same with text field because in text field I see the cursor blinking.
see image if confused. :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的意思是要禁用文本输入字段吗? (这就是我能想到的)。试试这个:
你想实现什么目标?
编辑:只读:
我认为这就是您正在寻找的。只读,没有焦点。
编辑3,解决选项卡索引问题:
Did you mean you want to disable the text input field? (Thats what I can think). Try this:
What are you trying to accomplish?
Edit: Read only:
I think this is what you are looking for. Read only with no focus.
Edit 3, Solving Tab Index problem:
您应该使用 jQuery UI 的自动完成:
http://jqueryui.com/demos/autocomplete/#combobox
You should use jQuery UI's Autocomplete:
http://jqueryui.com/demos/autocomplete/#combobox
如果您不想使用任何 JavaScript 框架,您可以创建自己的 Java 脚本代码来进行自动完成。请查看本页中的示例 -->
AutoComplete 文本框自动完成
If you do not want to use any javascript framework, you can create your own java script code for autocomplete. Please look into the example in this page -->
AutoComplete text box autocomplete