<p>I would like to be able to use the <kbd>Tab</kbd> key within a text box to tab over four spaces. The way it is now, the Tab key jumps my cursor to the next input.</p>

<p>Is there some JavaScript that will capture the Tab key in the text box before it bubbles up to the UI?</p>

<p>I understand some browsers (i.e. FireFox) may not allow this. How about a custom key-combo like <kbd>Shift</kbd>+<kbd>Tab</kbd>, or <kbd>Ctrl</kbd>+<kbd>Q</kbd>?</p>

The previous answer is fine, but I'm one of those guys that's firmly against mixing behavior with presentation (putting JavaScript in my HTML) so I prefer to put my event handling logic in my JavaScript files. Additionally, not all browsers implement event (or e) the same way. You may want to do a check prior to running any logic:
```
```
document.onkeydown = TabExample;

function TabExample(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var tabKey = 9;
  if(evt.keyCode == tabKey) {
    // do work
  }
}
```
```