Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是两个问题,但也是一个问题:
如何获取当前/选定的对象 CSS class?
class
如何设置当前/选定对象 CSS class?
我正在使用 TinyMCE 3.5.8(jQuery 版本)。
您可以使用
var node = tinymce.get('your_editor_id').selection.getNode();
和班级
$(node).attr("class");