document.execCommand 与 document.selection.createRange()

document.execCommand 与 document.selection.createRange().execCommand 在IE中的区别

并尝试从深层解释一下它.

阅读 2.4k
1 个回答

我在 IE11 和 Chrominum 里都试过,没有 document.selection,只有 document.getSelection(),而且 document.getSelection() 返回的对象也没有 createRange()方法

所以……你是用的哪个版本的IE?

另外,建议你试试下面的比较,看看结果是啥

document.execCommand === document.selection.createRange().execCommand
document.execCommand == document.selection.createRange().execCommand
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题