有没有一种方法可以从
例如:
假设1:在单词“quick”后光标闪烁。查询该函数必须返回“the quick”。 假设2:句子末尾有光标闪烁。查询该函数必须返回“the quick brown fox jumps over a lazy dog.”。
contenteditable div
的开头获取文本到光标位置。例如:
<div id="editableDiv" contenteditable="true">
the quick brown fox jumps over a lazy dog.
</div>
假设1:在单词“quick”后光标闪烁。查询该函数必须返回“the quick”。 假设2:句子末尾有光标闪烁。查询该函数必须返回“the quick brown fox jumps over a lazy dog.”。
--->
http://stackoverflow.com/questions/17613431/jquery-get-the-cursor-position-after-click - Jai