HTML---TextArea is initialized with a table space and the TAB key operation is invalid

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.