1、获取CKEditor被选中的内容
var mySelection = CKEDITOR.instances.ckStem.getSelection();
if (CKEDITOR.env.ie) {
mySelection.unlock(true);
data = mySelection.getNative().createRange().text;
} else {
data = mySelection.getNative();
}
2、获取CKEditor纯文本
var stemTxt=CKEDITOR.instances.CKEditor1.document.getBody().getText(); //取得纯文本
3、获取CKEditor带HTML标签的文本
var stem = CKEDITOR.instances.CKEditor1.getData();
var mySelection = CKEDITOR.instances.ckStem.getSelection();
if (CKEDITOR.env.ie) {
mySelection.unlock(true);
data = mySelection.getNative().createRange().text;
} else {
data = mySelection.getNative();
}
2、获取CKEditor纯文本
var stemTxt=CKEDITOR.instances.CKEditor1.document.getBody().getText(); //取得纯文本
3、获取CKEditor带HTML标签的文本
var stem = CKEDITOR.instances.CKEditor1.getData();