【问题标题】:how to set id to an element inside tiny mce如何将id设置为tinymce中的元素
【发布时间】:2010-07-08 05:37:16
【问题描述】:

我想为正在使用 tine mce 实例编辑的元素添加一个 Id 吗?有什么办法吗?

【问题讨论】:

    标签: tinymce


    【解决方案1】:

    是的,有办法。您需要获取 selections 父节点并在那里应用属性 id:

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

    【讨论】:

    • 您的其他 tinymce 问题呢? (他们还对你开放吗?)
    • 谢谢 Thariama :) 是的,他们是......但我正在用其他方式管理......但这个解决方案很棒......再次感谢......
    猜你喜欢
    • 2011-01-13
    • 2013-05-31
    • 1970-01-01
    • 2014-11-16
    • 1970-01-01
    • 2016-04-02
    • 1970-01-01
    • 2013-10-06
    • 2013-01-22
    相关资源
    最近更新 更多