我想用jquery获取tinyeditor textarea的值,我已写道:
var description = new TINY.editor.edit('description', {
id: 'description',
width: 330,
height: 175,
cssclass: 'tinyeditor',
controlclass: 'tinyeditor-control',
rowclass: 'tinyeditor-header',
dividerclass: 'tinyeditor-divider',
controls: ['bold', 'italic', 'underline', 'strikethrough', '|',
'orderedlist', 'unorderedlist', '|', 'undo', 'redo'],
footer: true,
fonts: ['Verdana', 'Arial', 'Georgia', 'Trebuchet MS'],
footerclass: 'tinyeditor-footer',
resize: {cssclass: 'resize'}
});
使用jquery获取值:
$('#p_description').html($('#description').val()); // does not work
$('#p_description').html(description.post()); // does not work
$('#p_description').html(TINY.editor.description.value); // does not work
以及其他一些方式..
任何帮助或建议都将是一个很大的帮助..提前感谢
答案 0 :(得分:1)
我找到了解决方案..所以我想与大家分享..
description.post();
var p_description = description.t.value;
然后:
$('#p_description').html(p_description);