Skip to content

Instantly share code, notes, and snippets.

@taurenshaman
Created June 5, 2020 11:27
Show Gist options
  • Save taurenshaman/429bcf35ec9724696ed08f8e2a3bbe67 to your computer and use it in GitHub Desktop.
Save taurenshaman/429bcf35ec9724696ed08f8e2a3bbe67 to your computer and use it in GitHub Desktop.
Disable Tab navigation
document.onkeydown = function (evt) {
if (evt.which === 9) {
//console.log(evt);
return false;
}
}
// source: https://www.sanwebcorner.com/2016/07/how-to-disable-tab-key-in-web-page.html
// if wanna disable a spesific element:
//<input tabindex="-1" placeholder="NoTabIndex" />
// source: https://stackoverflow.com/questions/5192859/how-to-ignore-html-element-from-tabindex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment