复制代码代码如下:
<input type = "button" onClick = "cleanword ();" valor = "palabra 清理" />
Cleanword = function () {
var editBody = fckeditorapi.getInstance ("Text"). EditorDocument.body;
var html = fckeditorapi.getInstance ("texto"). editordOcument.body.inntext;
for (var intloop = 0; intloop <editBody.all.length; intloop ++) {
el = editBody.all [intloop];
el.removeattribute ("classname", "", 0);
el.removeattribute ("estilo", "", 0);
el.removeattribute ("fuente", "", 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 ("texto"). EditorDocument.body.inntext = html;
}