0

如何使用 cssApplier 将跨度的属性名称放在 Ragy 中。一个例子:

<span name="##" id ="##" class="note">

我尝试:

highlighter.addCssClassApplier(rangy.createCssClassApplier("note", {
            ignoreWhiteSpace: true,
            elementTagName: ["span"],
            elementProperties: {
                name:"##",
                id:"##",
                onmousedown: function (){
                    if (event.button==2){
                    var highlight = highlighter.getHighlightForElement(this);
                    if (window.confirm("Delete this new note ?")) {
                        highlighter.removeHighlights( [highlight] );
                    }
                    return false;
                }
                }
            }
        }

但它不起作用。结果是:

<span  id ="##" class="note">

它是范围内的错误吗?

4

0 回答 0