简体   繁体   English

用于查找TinyMCE富文本编辑器值的JavaScript是否为null

[英]JavaScript to find TinyMCE rich text editor value is null or not

I use the TinyMCE textarea in one of my web applications. 我在我的一个Web应用程序中使用TinyMCE textarea。

  1. How to check the TinyMCE textarea's value is null or not using JavaScript? 如何检查TinyMCE textarea的值是null还是不使用JavaScript?

document.getElementById("myeditorid").value didn't help me. document.getElementById("myeditorid").value对我没有帮助。

It's not a textarea any more, so the value property won't work. 它不再是textarea,所以value属性不起作用。

This is how you get a reference to the editor, and the text from it: 这是您获得对编辑器及其文本的引用的方式:

var text = tinyMCE.get('myeditorid').getContent();
var text = tinyMCE.get('createSurvey:thankyouMsg_ifr').getContent();

这里预定义的id是“thankyouMsg”..在tinyMCe之后,它的id改为this.I尝试以这种方式获取值,但是没有工作说tinyMCE.get('createSurvey:thankyouMsg_ifr')是未定义的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM