Jump to content

How to get the index of a cursor in a textfield?


littlefat

Recommended Posts

In my project, I really need to get the start position and the end position of the part of text that the user selects in a textfield or textarea of a form. One JavaScript funtion I write needs to know these two attributes to continue working. To get the position of a cursor in the textfield will be also useful. Anyway, I find DOM doesn't support this at all. Are there any other ways or tricks to get it? Thanks very much!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...