This article mainly introduces how to use JS to clear the Word format. For more information, see
The Code is as follows:
CleanWord = function (){
Var editBody = FCKeditorAPI. GetInstance ("text"). EditorDocument. body;
Var html = FCKeditorAPI. GetInstance ("text"). EditorDocument. body. innerText;
For (var intLoop = 0; intLoop El = editBody. all [intLoop];
El. removeAttribute ("className", "", 0 );
El. removeAttribute ("style", "", 0 );
El. removeAttribute ("font", "", 0 );
}
Html = html. replace (/ <\/O: p>/g ,"");
Html = html. replace (/o:/g ,"");
Html = html. replace (// g ,"");
Html = html. replace (// g ,"");
Html = html. replace (// g ,"");
Html = html. replace (/ /G ,"");
Html = html. replace (/ /G ,"");
Html = html. replace (/
/G ,"");
Html = html. replace (/<\/P>/g ,"");
Html = html. replace (/<\/SPAN>/g ,"");
FCKeditorAPI. GetInstance ("text"). EditorDocument. body. innerText = html;
}