• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic