Clearing text in a WYSIWYG text editor

I am using the HTML editor WYSIWYG Editor

http://imperavi.com/redactor/examples/toolbar-external/ 

I am trying to clear a text area after an on: click event.

however, since it uses div wrappers for a text editor, I cannot figure out how to do this.

+4
source share
1 answer

It works:

 $('.redactor_editor').html(''); 

You just need to bind this to the onclick event, for example:

 $('.clear_editor').click(function () { $('.redactor_editor').html(''); }); 

The above description will clear the text area of ​​the editor when you click on an element with the class .clear_editor

In case you use Angular and [(froalaModel)], you need to set the string passed to froalaModel as undefined instead of ''

+3
source

Source: https://habr.com/ru/post/1482877/


All Articles