如果我使用 execCommand 方法来突出显示选定的文本:
document.execCommand("HiliteColor", false, colour);
按照建议in this page ,然后我想回来取消高亮格式(也就是回到我高亮某段文字之前的状态),怎么办?
最佳答案
以下将删除格式:
document.execCommand("RemoveFormat", false, null);
关于javascript:如何反转 range.execCommand 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7506260/