0

How can i put the atribute name of a span in Ragy with cssApplier. One example:

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

i try:

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;
                }
                }
            }
        }

But it doesnt work. it was a result:

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

Is it a bug in rangy?

Martin
  • 1,282
  • 1
  • 15
  • 43
  • ID/Name/Class names must begin with an alphabet or underscore and should not contain any special characters. – Jay Oct 03 '12 at 00:07
  • oh yes, I've tried putting numbers and letters.But it does not work. i try elementProperties: { name:"content", id:"one", ... } – Martin Oct 03 '12 at 08:15
  • Which version of Rangy are you using? Which browser? A quick test on Rangy 1.3 worked fine, but I need more information. Also, you need to be aware that it is invalid in HTML for multiple elements to have the same ID, and there's no guarantee that Rangy's CSS class applier will only create one `` element, so specifying an the ID in the element properties is generally a bad idea. – Tim Down Oct 04 '12 at 23:44
  • I use rangy-1.3alpha.681 and chrome. – Martin Oct 05 '12 at 08:46

0 Answers0