1 There is a tab space when initializing
This is because the content between <textarea></textarea> is not empty, including spaces and line breaks, or the browser will think that spaces or line breaks are the contents of a text field, so you write <textarea></ Textarea> close together;
2 Tab key is not valid for textarea operation Using the TAB key in textarea is not valid and switches to another control, but when we have a need to be able to use the TAB key in a text field, you can use JavaScript or jquery:Way 1:javascript<script src= "Http://julianlam.github.com/tabIndent.js/js/tabIndent.js" ></script><!-- Import the Tabindent.js Script--<script>tabindent.renderall ();</script><!--app Script--class= in the TextArea tab " Tabindent "Example:
<! DOCTYPE html><style type= "text/css" >.demo{width:600px; margin:30px auto; color: #51555c}.demo h3{height:32px; line-height : 32px; Font-size:18px}.demo h3 span{float:right; font-size:32px; font-family:georgia,serif; color: #ccc; Overflow:hidden}. Demo textarea{width:600px;height:50px;} </style>
<script src= "Tabindent.js" ></script><textarea name= "Saytxt" id= "Saytxt " class= "Tabindent"></textarea> <script>tabindent.renderall ();</script></div></body>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
HTML---TextArea is initialized with a table space and the TAB key operation is invalid