Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- var tabKeyPressed = false;
- $(document).keydown(function(e) { //вместо document тут и ниже, можешь поставить селектор формы
- tabKeyPressed = e.keyCode == 9;
- if (tabKeyPressed) {
- e.preventDefault();
- return;
- }
- });
- $(document).keyup(function(e) {
- if (tabKeyPressed) {
- alert('tab') //тут можно вставить dataLayer для автоэвента
- e.preventDefault();
- return;
- }
- //Do other stuff when not TAB
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement