复制代码代码如下:
<entrée type = "bouton" onClick = "Cleanword ();" value = "word 清理" />
cleanword = function () {
var editBody = fckEditorapi.getInstance ("texte"). editordocument.body;
var html = fckEditorapi.getInstance ("texte"). editordocument.body.innerText;
pour (var intloop = 0; intloop <editBody.all.length; intloop ++) {
el = editBody.all [intloop];
el.RemoveAttribute ("className", "", 0);
El.RemoveAttribute ("style", "", 0);
El.RemoveAttribute ("Font", "", 0);
}
html = html.replace (/ <o: p> <// o: p> / g, "");
html = html.replace (/ o: / g, "");
html = html.replace (/ <font> / g, "");
html = html.replace (/ <font> / g, "");
html = html.replace (/ <span> / g, "");
html = html.replace (/ <span> / g, "");
html = html.replace (/ <spanlang = en-us> / g, "");
html = html.replace (/ <p> / g, "");
html = html.replace (/ <// p> / g, "");
html = html.replace (/ <// span> / g, "");
FckEditorapi.getInstance ("texte"). Editordocument.body.innertext = html;
}