Peder Johnson Peder Johnson - 1 month ago 6
CSS Question

Change default tab function on a website

For every web browser, pressing the

Tab
key cycles through selecting the various input elements / links etc. on the page. I want to make it so that when a user presses
Tab
in a
<textarea>
, it creates a "tab" character like in a text document. How can that be done?

Answer

This has already been answered, for example here. Basically you catch the keypress, prevent default behaviour and indent you textarea instead. For an example, please check out the provided link.

Comments