【问题标题】:text box with unselectable ='on' getting selected in ie on tab press from previous text field带有不可选择 ='on' 的文本框在 ie 中被选中
【发布时间】:2012-11-22 06:48:17
【问题描述】:

textboxunselectable ='on' 在 ie 中被选中,用于从上一个文本字段中按下制表符。

form 'input1' on tab press 它应该转到 'input3' 而不选择 input2。

< input name="input1" type="text" value="input1"  / >
< input name="input2" type="text" value="input2" unselectable="on" />
< input name="input3" type="text"  />
< button>clickme< /button>

我尝试如下,

$("input[unselectable]").focus(function(){
            $(this).blur();
        });
$(input[unselectable]).focus(function(){
        $(this).next('input').focus();
     });

但它不起作用,即。

这里的另一种情况是如果'input3'也是unselectable="on"在'input1'的按标签上它应该转到按钮/锚等..

javascriptjquery 或任何其他想法中的解决方案..

【问题讨论】:

    标签: button input tabs focus selected


    【解决方案1】:

    只需在

    中定义 tabindex = -1
    < input name="input2" type="text" value="input2" unselectable="on" tabindex = -1 />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-19
      • 2014-04-14
      • 1970-01-01
      • 2023-04-02
      相关资源
      最近更新 更多