Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在移动浏览器上,有没有办法readonly=true在保持插入符号或文本插入光标正常工作的同时阻止默认键盘(例如在使用 textarea 上的属性时)?使用户能够在文本区域内选择一个位置,而不弹出键盘?
readonly=true
我不完全确定这会阻止键盘出现,但这会阻止用户在 textarea 中输入:
<textarea maxlength="0">Put your text here</textarea>
请记住,低于 9 的 Internet Explorer 不支持此功能,Opera 也不支持此功能。看到您的目标是移动设备,这应该不是问题。