Obtain the div editing box, textarea, and inputtext. The cursor position is compatible with IE, FF, and Chrome. _ javascript skills

Source: Internet
Author: User
Obtain the div editing box, textarea, and inputtext. The cursor position is compatible with the IE, FF, and Chrome methods. If you have any need, you can refer to the online solution for 2 hours, but it is not compatible with FF, it seems that this kind of thing is not ready for use on the Internet.
Now released, there will be ready-made online for people to use.

In order to save trouble, it is also very convenient to use jquery to change the native JS in a few places. If you need it, Please modify it on your own.
You are welcome to pass by and leave a message to improve the code.
It is also compatible with the latest version of Chrome code.
Source code

The Code is as follows:





Js obtains the cursor position of the p edit box, textarea, and input text, compatible with FF and IE

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.