扫码关注官方订阅号
document.execCommand 与 document.selection.createRange().execCommand 在IE中的区别
并尝试从深层解释一下它.
欢迎选择我的课程,让我们一起见证您的进步~~
我在 IE11 和 Chrominum 里都试过,没有 document.selection,只有 document.getSelection(),而且 document.getSelection() 返回的对象也没有 createRange()方法
document.selection
document.getSelection()
createRange()
所以……你是用的哪个版本的IE?
另外,建议你试试下面的比较,看看结果是啥
document.execCommand === document.selection.createRange().execCommand document.execCommand == document.selection.createRange().execCommand
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
我在 IE11 和 Chrominum 里都试过,没有
document.selection,只有document.getSelection(),而且document.getSelection()返回的对象也没有createRange()方法所以……你是用的哪个版本的IE?
另外,建议你试试下面的比较,看看结果是啥