0

I'm using Rangy 1.3 TextRange in order to find text in a div and wrap it with a span. I want to add more attributes to the span by adding the option elementProperties but the attributes aren't added at all.

var applier = rangy.createCssClassApplier(
                 "result", 
                 { 
                    elementProperties: {
                     'data-value': 1
                    }
                 } 
              );

I'm using Rangy 1.3 and testing it on Chromium.

Tim Down
  • 318,141
  • 75
  • 454
  • 536
carmina
  • 307
  • 2
  • 10

1 Answers1

1

elementProperties is for setting properties on elements rather than attributes. I have recently added elementAttributes as well (but not yet documented it), so you could use that instead for data attributes. The latest 1.3 release of Rangy has it.

Tim Down
  • 318,141
  • 75
  • 454
  • 536