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
  • 23,730
  • 77
  • 197
  • 300
  • 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
  • 8,967
  • 11
  • 53
  • 95
0

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

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

Jaime Garcia
  • 6,274
  • 7
  • 48
  • 61