admin管理员组

文章数量:1388868

With this code I can check the caret position in a textarea in firefox:

document.getElementById("myTextArea").selectionStart

This doesn't work in IE 8. How can I get the caret position in IE 8?

With this code I can check the caret position in a textarea in firefox:

document.getElementById("myTextArea").selectionStart

This doesn't work in IE 8. How can I get the caret position in IE 8?

Share Improve this question edited Apr 13, 2010 at 9:28 kayahr asked Apr 13, 2010 at 9:14 kayahrkayahr 22.1k30 gold badges105 silver badges148 bronze badges 1
  • 1 Possible duplicate: stackoverflow./questions/263743/… – Tim Down Commented Apr 13, 2010 at 9:37
Add a ment  | 

1 Answer 1

Reset to default 2

See the answers here: Caret position in textarea, in characters from the start

Edit

I sorted out the line breaks issue in IE and posted an answer here: Caret position in textarea, in characters from the start

本文标签: javascripttextareaselectionStart in IEStack Overflow