富文本框ckeditor_4.4.7 文本框的简单使用 支持IE11

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>知识库内容编辑</title>
<script type="text/javascript" src="./ckeditor.js"></script>
<script type="text/javascript">
     var editor = null;
    window.onload = function(){
        editor = CKEDITOR.replace('content'); //参数‘content’是textarea元素的name属性值,而非id属性值
    }
function saveMethod(){
var cc = CKEDITOR.instances.content.getData();
//  var cc=editor.updateElement();
alert(cc);
CKEDITOR.instances.content.setData("11");
    }
</script>
</head>
<body>
<form id="detailForm" method="post">
    <textarea id="content" name="content"></textarea>
    <input type="button" value="保存" id="save" onclick="saveMethod();" />
</form>
</body>
</html>

你可能感兴趣的:(富文本框)