我有这个工作代码片段:
var replaceItem = new RegExp(wordToReplace,"g");
document.body.innerHTML = document.body.innerHTML.replace(replaceItem, " <a href='test.html' target='_self'><span style='color:green' title='"+word+"'>"+word+"</span></a>");
如何使用Document.createDocumentFragment()来提高效率呢?