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
1 Answer
Reset to default 5Created 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
评论列表(0条)