I'm trying to remove leading and trailing white spaces in TinyMCE text area.
var frontandbackremovedhere = tinyMCE.get('ID').getContent().trim();
I tried above but not working.how can I do this
for example
If I inset following text in editor
Hi,
Regards
kez
It will get the html as following
<p> Hi,<br><br>Regards<br><br></p><p>kez </p>
I'm trying to remove it like this
<p>Hi, <br><br>Regards<br><br></p><p>kez</p>
用这个
var frontandbackremovedhere=$.trim(tinyMCE.get('ID').getContent());
let editorContent = tinyMCE.get('ID').getContent({format:'raw'}).trim();
tinyMCE.get('ID').setContent(editorContent);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.