【发布时间】:2017-10-17 05:25:38
【问题描述】:
与:
<div contenteditable="true"> ... text.... <img src="image.png" height="50" width="50" onmouseup="alert(window.getSelection().isCollapsed)"> ... text... </div>
如果我在 firefox 警报中单击(img 上的鼠标)显示:'false', 在 chrome 警报中说:'true'。 为什么不一样? (火狐好像提示有选中的文字)
与:
<div contenteditable="true"> ... text.... <img src="image.png" alt="hello" height="50" width="50" onmouseup="alert(window.getSelection().toString())"> ... text... </div>
如果我在 Firefox 警报中单击(鼠标在 img 上)说:“你好”, 在 chrome 警报中说:''。 为什么 Firefox 说我选择了“你好”文本?火狐错了,chrome没有?
【问题讨论】:
标签: javascript google-chrome firefox