treant-js
treant-js copied to clipboard
data attribute not setting
when using innerHTML value for node {'text': {'data-attribute': 'some value'}}
does not works. It does not set data-attribute for that node. Why is that? Is there any work around?
I don't know if your issue was the same as mine; however, what I had to do to have the data attributes appear is perform:
{'text': {'node-data-avg': 1000}}
as an example. I.e., prefix with node-
.
This is a super old post, but i faced the same issue here in 2023, turns out, the "release" and also cdnjs have not been updated in forever. however, if you pull the Treat.js file from github directly, it does seem to work (for me).
moral of the story, don't trust cdnjs or even the github releases to be up to date.