你可以execcommand在文档之外的元素上做吗?
我想知道你是否可以编写这样的代码:
contentDiv.execCommand()
代替:
document.execCommand()
你可以execcommand在文档之外的元素上做吗?
我想知道你是否可以编写这样的代码:
contentDiv.execCommand()
代替:
document.execCommand()
No.execCommand()仅限于HTMLDocument节点(请参阅进行中的 HTML 编辑规范),除了 IE,它们的专有TextRange和ControlRange对象也支持execCommand().