javascript:如何反转range.execCommand方法
作者:互联网
如果我使用execCommand方法突出显示所选文本:
document.execCommand("HiliteColor", false, colour);
如建议in this page,然后我想返回并取消突出显示格式(即返回到突出显示某些文本之前的状态),该怎么办?
解决方法:
以下内容将删除格式:
document.execCommand("RemoveFormat", false, null);
标签:highlight,selection,execcommand,javascript 来源: https://codeday.me/bug/20191102/1989464.html