最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - textarea.selectionStart in IE - Stack Overflow

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论