javascript - Tab out of input not working - Stack Overflow

I have a input as following<input type="text" id="allSchoolsListText" size="

I have a input as following

<input type="text" id="allSchoolsListText" size="100" style="width: 85%" value="All Colleges and Universities" placeholder="All Colleges and Universities" alt="All Colleges and Universities">

it has a click event inside js file

When I press "tab" button the focus es on html controls in the website, but when the focus es to above mentioned input, then it never goes out even if you press tab n number of times.

I have a input as following

<input type="text" id="allSchoolsListText" size="100" style="width: 85%" value="All Colleges and Universities" placeholder="All Colleges and Universities" alt="All Colleges and Universities">

it has a click event inside js file

When I press "tab" button the focus es on html controls in the website, but when the focus es to above mentioned input, then it never goes out even if you press tab n number of times.

Share Improve this question asked Jul 2, 2015 at 11:38 Tushar ThakurTushar Thakur 9863 gold badges16 silver badges33 bronze badges 2
  • 2 put your javascript code. With the html <input> tag we can't know what you're doing – Marcos Pérez Gude Commented Jul 2, 2015 at 11:40
  • You need to read How to Ask, then create MCVE – Amit Commented Jul 2, 2015 at 11:41
Add a ment  | 

1 Answer 1

Reset to default 5

Created small example on how this can be happen:

var input = document.querySelector("#test");
console.log(input);
input.addEventListener('keydown', function(e) {
    // Capture the tab keyevent, and make it not do the default behavior.
    if (e.which === 9) {
        e.preventDefault();
        alert("Tab failed");
    };
});
<input id="test" type="text">

So what you have to do is see if the click event's handler has something that catch and prevent the default behavior when press the tab key.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745380697a4625211.html

相关推荐

  • javascript - Tab out of input not working - Stack Overflow

    I have a input as following<input type="text" id="allSchoolsListText" size="

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信