复制代码代码如下:
<input type = "tombol" ontClick = "cleanword ();" value = "Word 清理" />
cleanword = function () {
var editbody = fckEditorapi.getInstance ("text"). editordocument.body;
var html = fckEditorapi.getInstance ("Text"). Editordocument.body.innerText;
untuk (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 ("text"). Editordocument.body.innertext = html;
}