Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A lot of the time, when I want to format text within a web page's text box I'll hit the Tab key.

Unfortunately, that doesn't insert the tab character but instead moves the control to the next form element (like a button or a check box).

For browsers like Firefox/IE, is there a way to get the formatting behavior of a tab, within a text box, by typing a key combination?

share|improve this question

12 Answers 12

up vote 10 down vote accepted

Tabinta is a Firefox add-on that lets you do this.

share|improve this answer
Any solution for Chrome? – sorin Mar 16 '12 at 14:47
@SorinSbarnea: See my answer – Janus Troelsen Jan 20 '14 at 12:13

In Windows, you can push Alt+09. This only works with the number pad number keys. (Release Alt after pressing the last number key.)

share|improve this answer
Be sure you are using the NumPad keys – CatamountJack Mar 17 '10 at 0:30
This is perfect. To clarify (on any version of Windows): Hold your ALT key. Press and release 0 on the numeric keypad. Press and release 9 on the numeric keypad. Release the ALT key. Then cut and paste the Tab you just made if you have to do it a bunch! – Chris Mar 24 '10 at 0:38
@Chris: When I follow those exact instructions, it doesn't insert a tab character, but acts like the tab key. Did you try this in a web browser? – Casebash Apr 9 '10 at 4:39
Only if you have Windows and a keyboard with a numpad. – Mechanical snail Oct 11 '11 at 4:15
I does not work on ubuntu with chrome – sorin Mar 16 '12 at 14:45

Linux and other POSIX systems (except Mac OS):

To input tabs in GTK+ applications (like Firefox or Chrome):


Source: Wikipedia: Unicode Input

share|improve this answer
thanks! the best solution for a linux laptop without a numpad – akostadinov Nov 7 '12 at 16:08
I don't think this works in Chrome on a Mac. – jcollum May 23 at 15:26
@jcollum Chrome does not use GTK+ on Macs. – Janus Troelsen May 24 at 12:45

In Safari and Firefox on Mac OS X, you can press ControlOptionTab to insert a tab in the text field you're currently editing.

share|improve this answer
Looks like this doesn't work in Chrome 50 on El Cap – jcollum May 23 at 15:24

There is a Chrome plugin called Textarea Code Formatter.

It allows you insert tabs into text boxes in the Chrome browser. It also allows you to highlight multiple lines and insert tabs before each selected line.

However, an issue is that often you want standard tab insertion behaviour. If you do use tab to toggle between boxes, then you may to select "disabled" by default in the options.

share|improve this answer

If it's your site:

jQuery plugin:

jQuery(document).ready(function () {



Load jQuery and the plugin first, then you can tab and make a tab, and shift+tab to "untab" as it were.

For browser-wide support, you will have to use an extension, userscript, plugin, etc. like: 46704 for Greasemonkey. (I would have linked, but I'm limited to 1.)

share|improve this answer
The link is dead. What's with all this jQuery stuff. There's got to be a way to accept tabs using plain JavaScript. The jQuery plugin is always nice for an already-implemented solution, but it's not really the solution. – Triynko Apr 22 '14 at 22:17
Try this chief: – Grizly Apr 23 '14 at 2:15

Open Notepad or similar text editor, and start a new blank document. Type Tab. Copy your tab character to the clipboard. (On Windows, Ctrl+A, Ctrl+C will do this).

Now switch back to the textarea in your browser. Position the cursor where you want it, and paste the tab character. (Ctrl+V on Windows).

Voila, done!

share|improve this answer
Ciro, is it broken for regular textboxes and text input fields, or just "contenteditable" elements? Because if it's just a problem for "contenteditable", it might not affect that many people (the OP for example)... – Doin Aug 1 '15 at 12:46
This was the simplest solution, unless you need to do this frequently. – jcollum May 23 at 15:33

The big advantage of Tabinta in Firefox is that you can map the tab character to another hotkey, since you really don't want to lose the tab key default behavior in the browser.

With Internet Explorer you have no solution in the way of browser extensions that I am aware of. Here the only way is to keep the tab character in the clipboard by having previously copied it from some other program like notepad.

javascript solutions require the name of the textbox where they will act on, so this is far from ideal or practical. While alt keycode combinations under both browsers still execute the normal tab character keypress event so they don't work either.

share|improve this answer

I've messed wit AutoHotkey a bit to get this ability, and the only 'bulletproof' solution I found is really to paste (not send) the tab character itself.

; TAB character
; pasted from clipboard
; win tab

It turns out that this AHK bind is even useful in text editors that handles the TAB keystroke extra; eg. IDE configured to use autoindent-by-spaces.

share|improve this answer

Tab Grabber is kinda like Tabinta, only for Chrome (allows TABs in textarea fields).

share|improve this answer

Use jQuerry's tabby! Supports select row and press tab odr SHIFT TAB

share|improve this answer

To type the tab key in a text box, you can use a script like this (text box which accepts tab keys is named txtLongText):


txtLongText.Attributes.Add("onkeydown", _
"if(event.which || event.keyCode){if ((event.which == 9)" & _ 
"|| (event.keyCode == 9)) {document.getElementById('" & _ 
txtLongText.ClientID + "').selection = " & _
document.selection.createRange();" & _ 
txtLongText.ClientID & ".selection.text = " & _
" String.fromCharCode(9);return false;}} else {return true}; ")


"if(event.which || event.keyCode){if ((event.which == 9)" +
"|| (event.keyCode == 9)) {document.getElementById('"+
txtLongText.ClientID + "').selection = document.selection.createRange();" + 
txtLongText.ClientID + ".selection.text = String.fromCharCode(9);return false;}} else {return true}; ");

Or better, to avoid hard coding, you can put this code in a function named EnableTabType. The function has only one parameter, which specifies what is TextBox control where you need to enable typing of Tab characters.


Public Sub EnableTabType(tb As TextBox)
    tb.Attributes.Add("onkeydown", _
    "if(event.which || event.keyCode){if((event.which == 9)" & _ 
    "|| (event.keyCode == 9)) {document.getElementById('" & _ 
    tb.ClientID & "').selection=document.selection.createRange();" & _
    tb.ClientID & ".selection.text = " & _
    " String.fromCharCode(9);return false;}}else{return true};")
End Sub 


public void EnableTabType(TextBox tb)
    "if(event.which || event.keyCode){if ((event.which == 9)" +
    "|| (event.keyCode == 9)) {document.getElementById('"+
    tb.ClientID + "').selection = document.selection.createRange();" +
    tb.ClientID + ".selection.text = String.fromCharCode(9);return false;}} else {return true}; ");


share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .