读书人

关于js给KindEditor的textarea框赋值的

发布时间: 2013-03-06 16:20:31 作者: rapoo

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

读书人网 >Java Web开发

热点推荐