html – 跳过只读文本框

html – 跳过只读文本框,第1张

概述参见英文答案 > How to ignore HTML element from tabindex?                                    7个 我正在使用CSS使两个复选框看起来像一个… input { font-family: serif; font-size: 1.3em; background: rgba(5, 1, 0, .7); /* R 参见英文答案 > How to ignore HTML element from tabindex?                                    7个
我正在使用CSS使两个复选框看起来像一个…

input {  Font-family: serif;  Font-size: 1.3em;  background: rgba(5,1,.7);  /* Really good color!! */  color: white;}.one {  border: 1px solID black;  border-radius: 3px 0px 0px 3px;  border-right: none;  wIDth: 58px;  padding: 14px;  Transition: all .7s ease-in;}.two {  border: 1px solID black;  border-radius: 0px 3px 3px 0px;  text-decoration: none;  border-left: none;  wIDth: 100px;  text-align: right;  padding: 14px;  Transition: all .7s ease;}input:focus {  border: 1px solID black;  Box-shadow: 0px 0px 0px white;  outline: none;}.one:focus {  border-right: none;}.two:focus {  border-left: none;  wIDth: 100px;}
<input type="text"><br><br><input type="text"  value="name:" Readonly><input type="text"  placeholder="John Doe"><br><br>

问题是,当用户通过文本框进行选项卡时,他会选中只读的一个,这不应该是可聚焦的.我怎样才能使Readonly文本框不被关注,焦点跳到下一个文本框? Fiddle

解决方法 设置tabIndex

<input type="text"  tabIndex="-1" value="name:" Readonly>
总结

以上是内存溢出为你收集整理的html – 跳过只读文本框全部内容,希望文章能够帮你解决html – 跳过只读文本框所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1087937.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-27
下一篇2022-05-27

发表评论

登录后才能评论

评论列表(0条)

    保存