I am using the tinymce jquery plugin and trying to access the api after initializing the tinymce instance above the text box.
In this example, I have a hide button that, when clicked on, should hide the tinymce editor, but instead I get an error.
<html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript" src="js/tinymce/jquery.tinymce.js"></script> <script type="text/javascript" src="js/test.js"></script> </head> <body> <div><textarea id="textEditor" class="tinymce" disabled="disabled"></textarea></div> <input type ="button" id="hide" value="Hide tinymce"> </body> </html>
$(document).ready(function(){
Update . I now have 2 versions, one of which works by wrapping $ ("# textEditor"). tinymce (). hide (); line in the click function, and one that gives me tinyMCE, not defined only by the line itself.
Works:
$("#hide").click(function(){ $("#textEditor").tinymce().hide(); })
Does not work:
$("#textEditor").tinymce().hide();
source share