I have added the following code to my site to prevent tabbing, this applies to the whole document. Problem is that this obviously disables all tabbing throughout the site, how can I add a rule in to allow inputs to be tabbed? I tried adding .not(‘input’) but this doesnt seem to work.
$(document).keydown(function(objEvent) {
if (objEvent.keyCode == 9) {
objEvent.preventDefault();
}
});
Thanks
You can check the value of
document.activeElement.tagName.If nothing is selected,
document.activeElementwill be thebodytag in FireFox, Chrome, and thehtmltag in IE 7/8/9.