Remove the carriage return newline character from textarea in IE

Source: Internet
Author: User
In textarea, press enter to generate the Escape Character \ r \ n. In some cases, we do not need the two escape characters.

In textarea, press enter to generate the Escape Character \ r \ n. In some cases, we do not need these two escape characters, that is, clearing textarea. The following method is not empty, but can achieve similar results.

If you press enter in textarea and the content is submitted, the escape characters \ r \ n will be left in textarea, And the cursor will be in the second line. The following program transfers the focus out through alexa, and then pulls the cursor back to the very beginning of textarea through the onfocus = "this. value ='' "code, so that it can be easily cleared.

Effect demonstration
Related Article

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.