当前位置: 代码迷 >> Java Web开发 >> 关于js给KindEditor的textarea框赋值的有关问题
  详细解决方案

关于js给KindEditor的textarea框赋值的有关问题

热度:106   发布时间:2016-04-16 23:56:08.0
关于js给KindEditor的textarea框赋值的问题~
代码如下

<script>
        var editor;
        KindEditor.ready(function(K) {
           var options = {

width : '1000px',

height : '900px',

uploadJson : 'editor/jsp/upload_json.jsp',

fileManagerJson : 'editor/jsp/file_manager_json.jsp',

allowFileManager : true,

afterBlur: function(){

this.sync();


}
var editor = K.create('#editor_id', options);
prettyPrint();
});
</script>
<textarea id="editor_id" name="content" style="width:700px;height:300px;">

</textarea>


我想赋值给textarea但是发现使用document.getElementById('editor_id').value = content;
$("#editor_id").val(content);这2个都无法赋值求大神指点吧~~~来人吧~~感谢了~~~

------解决方案--------------------
document.getElementById('editor_id').setAttribute('value',content)
  相关解决方案