在IE中textarea.selectionStart [英] textarea.selectionStart in IE
本文介绍了在IE中textarea.selectionStart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用此代码,我可以检查Firefox中textarea的插入位置:
$ b
document.getElementById(myTextArea) .selectionStart
这在IE 8中不起作用。我如何获得IE 8中的插入符号位置?
解决方案
请参阅此处的答案: textarea中的插入符号位置,从开始的字符开始
编辑
我在IE中整理了换行符问题,并在此处发布了答案: textarea中的插入位置,从字符开始
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?
解决方案
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
这篇关于在IE中textarea.selectionStart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文