2 <%=Html.TextAreaFor(Model => Model.WORK_INTRODUCTION)%>
3 <script type="text/javascript">
4 CKEDITOR.replace('WORK_INTRODUCTION');
5 </script>
1、获取CKEditor被选中的内容
var mySelection = CKEDITOR.instances.WORK_INTRODUCTION.getSelection();
if (CKEDITOR.env.ie) {
mySelection.unlock(true);
data = mySelection.getNative().createRange().text;
} else {
data = mySelection.getNative();
}
2、获取CKEditor纯文本
var CText=CKEDITOR.instances.WORK_INTRODUCTION.document.getBody().getText(); //取得纯文本
3、获取CKEditor带HTML标签的文本
var CHtml= CKEDITOR.instances.WORK_INTRODUCTION.getData();
4、给CKEditor赋值
CKEDITOR.instances.WORK_INTRODUCTION.setData("要显示的文字内容");
参考文献:http://banu.blog.163.com/blog/static/2314648201282553627350/
http://blog.csdn.net/limlimlim/article/details/17113197
转载于:https://www.cnblogs.com/landiljy/p/5410242.html