我正在使用一个简短的 Jquery 脚本来实时预览一些输入字段。现在使用 TinyMCE,我无法获取tinyMCE 的值以将其插入 div 中。我发现了另一个线程Get value of tinymce textarea with jquery selector,但我真的不知道如何在我的代码中使用这个tipps。我是 jQuery 的初学者,非常感谢每一个帮助。
$(document).ready(function() {
updatePreview();
$('#live-preview-form input, #live-preview-form textarea').bind('blur keyup',updatePreview);
});
function updatePreview(){
var tinymce = $('#lp-message');
tinymce.html($('#message').val());
}
Run Code Online (Sandbox Code Playgroud)