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.
elementProperties
is for setting properties on elements rather than attributes. I have recently addedelementAttributes
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.