日期:2014-05-17  浏览次数:20688 次

关于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)