开发者

how to set id to an element inside tiny mce

开发者 https://www.devze.com 2023-01-05 22:33 出处:网络
I want to add an Id to the element which is 开发者_JAVA技巧being edited using a tine mce instance ? Is there any way ?Yes, there is a way. You need to get the selections parent node and apply the attr

I want to add an Id to the element which is 开发者_JAVA技巧being edited using a tine mce instance ? Is there any way ?


Yes, there is a way. You need to get the selections parent node and apply the attribute id there:

ed.onDesiredEvent.add(function(editor, event) {
    node = editor.selection.getNode();
    node.setAttribute('id','the_id_to_be_assigned');
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号