0

I hate when I try to edit html in textarea, because it doesn't recognize tab button, so I cannot indent my code. So is it possible to generate tab support to textareas with html? And is it possible to create support for tab button with JavaScript?

newbie
  • 24,286
  • 80
  • 201
  • 301
  • This is a duplicate of http://stackoverflow.com/questions/1105452/catching-tabs-in-textarea , which gives a solution using onkeydown. – Matthew Flaschen Mar 02 '10 at 20:50

2 Answers2

0

Try to check the key code in keyUp or keyDown events against the tab key code: 11.

Fitzchak Yitzchaki
  • 9,095
  • 12
  • 56
  • 96
0

Here's a tutorial that explains the process very well.

http://ajaxian.com/archives/handling-tabs-in-textareas

Jaime Garcia
  • 6,744
  • 7
  • 49
  • 61