javascript:如何反转range.execCommand方法

javascript:如何反转range.execCommand方法,javascript,selection,highlight,execcommand,Javascript,Selection,Highlight,Execcommand,如果使用execCommand方法高亮显示选定文本: document.execCommand("HiliteColor", false, colour); 根据建议,然后我想返回并取消突出显示格式(即,返回到突出显示某些文本之前的状态),我能做什么?以下内容将删除格式: document.execCommand("RemoveFormat", false, null);

如果使用execCommand方法高亮显示选定文本:

document.execCommand("HiliteColor", false, colour);

根据建议,然后我想返回并取消突出显示格式(即,返回到突出显示某些文本之前的状态),我能做什么?

以下内容将删除格式:

document.execCommand("RemoveFormat", false, null);