This article mainly introduces the use of JS to clean up Word format, the need for friends can refer to the following
Code as follows: <input type= "button" onclick= "Cleanword ()" value= "word cleanup"/> Cleanword = function () {& nbsp var editbody = fckeditorapi.getinstance ("text"). editordocument.body; var html = fckeditorapi.getinstance ("text"). editordocument.body.innertext; for (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; }