Get Caret Position within an Text Input field

Posted by MarkB29 on Stack Overflow See other posts from Stack Overflow or by MarkB29
Published on 2010-05-24T13:05:50Z Indexed on 2010/05/24 13:11 UTC
Read the original article Hit count: 194

Filed under:
|
|
|

How could can I get the caret position from within an input field.

I have seen a few bits and pieces on google but nothing bullet proof.

Basically something like a Jquery plugin would be ideal so I could simply do

$("#myinput").caretPosition()

I realise there may by other non-jQuery solutions and these would also be brilliant if anyone has any??

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript