admin管理员组文章数量:1391811
I've an editor in which I can select text and display it by the following code :
alert(tinyMCE.activeEditor.selection.getContent({format : "html"}));
the issue is the function returns only text and not HtmlElement. So I can't see, for example, the node which encapsulate this selected text. I would like to get the content but by an HtmlElement to deal with nodes.
Any suggestions ?
I've an editor in which I can select text and display it by the following code :
alert(tinyMCE.activeEditor.selection.getContent({format : "html"}));
the issue is the function returns only text and not HtmlElement. So I can't see, for example, the node which encapsulate this selected text. I would like to get the content but by an HtmlElement to deal with nodes.
Any suggestions ?
Share Improve this question asked Sep 14, 2017 at 9:44 CouimCouim 7473 gold badges13 silver badges29 bronze badges1 Answer
Reset to default 5Take a look at getNode()
:
tinymce.activeEditor.selection.getNode();
The API calls available on a selection are documented here: https://www.tiny.cloud/docs/tinymce/latest/apis/tinymce.dom.selection/#getNode
本文标签: javascripttinyMCE get the current selected HTML elementStack Overflow
版权声明:本文标题:javascript - tinyMCE get the current selected HTML element - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744769144a2624228.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论