Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Why does setAttrs update text in a span but not a div?

I'm trying to dynamically change header names of skills on a custom sheet. If the attribute is in a span, it updates when I change the value of the attribute. However if it is in a header or div it does not. Is this a roll20 thing or is that normal javascript behavior. setAttrs({strength_name: "Dexterity"}); will change the text in <span class="attribute-name" name="attr_strength_name">Strength</span> but not in <div class="attribute-name" name="attr_strength_name">Strength</div>
1602637897
GiGs
Pro
Sheet Author
API Scripter
Divs cannot hold attribute values on roll20. Only inputs, spans, selects, and textareas can. (Off the top of my head - if there are others, divs are not among them.) attribute values and names like this are a pure roll20 behaviour, and are only enabled for the above elements.
Thanks, Roll20 has some weird behaviors.