aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to get or set the caret position in text (JavaScript) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get or set the caret position in text (JavaScript)" Watch "How to get or set the caret position in text (JavaScript)" New topic
Author

How to get or set the caret position in text (JavaScript)

Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
In an input (text) or text area, is there a way to get or set the position of the caret? (I've always called it a cursor, but java API calls it a caret. Maybe 'cursor' sounds like something evil.) In java there are methods for it, but I can't seem to find anything in JavaScript.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get or set the caret position in text (JavaScript)