2011-11-26 77 views

回答

1

您可以使用document.execCommand()在调用window.find()后添加样式到当前选择。见我的答案在这里,例如:

https://stackoverflow.com/q/5887719/96100

+0

惊人的答案... 1000个Upvotes从我 – Exception

+0

这部分工作在IE。你可以请看看这篇文章,请... http://stackoverflow.com/questions/8284266/need-a-small-improvement-in-this-function – Exception

+0

@ user1008575:它适用于我在IE 7中很好。我在我的当前PC上没有IE 8。你能描述一个不起作用的例子吗? –