【发布时间】:2011-03-29 21:02:56
【问题描述】:
所以我的网页中有一个 contenteditable 按钮,我声明如下:
<button id="test" contentEditable="true">This <img src="image..png" /> is a button, click me!</button>
我移动插入符号,我想找到它的最终位置。我都试过了:
- window.getSelection().focusOffset.toString()
- document.getElementById('test').selectionStart.toString()";
但它们似乎都不起作用:(任何指针?
【问题讨论】:
标签: javascript button contenteditable caret