By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,310 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,310 IT Pros & Developers. It's quick & easy.

Get Caret Position (FireFox)

P: n/a
Is there a way to get the caret position of a text input using FireFox.
I am aware of ways to such with IE but have been unable to accomplish
in FireFox and have not found a solution in the groups or web. Anyone?
Thanks

Nov 3 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


ry******@yahoo.com wrote:
Is there a way to get the caret position of a text input using FireFox.


For textControls in Firefox/Mozilla you can read out
textControl.selectionStart
textControl.selectionEnd
selectionEnd should be the caret position.
To change the selection you can use
textControl.setSelectionRange(newSelectionStart, newSelectionEnd)

Opera 8 also supports those properties/methods on text controls.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 3 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.