Hello,
I have a need to create a data attribute for all my inputs, however for radiobuttons that attribute is associated with div created by the radiobutton itself instead of being associated with the actual radiobutton. Im sharing some images to help understanding.
Anyone know how to solve that?
Thanks!
If you do not find anything more native.
An approach I suggest is you can add dynamic class on every radiobutton and use that as the selector and add the attribute using JS
something like this
Hi I think it's because it is an Outsystems widget. But maybe you can add the attribute using javascript? on the onready event of the screen/block
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_setattribute1
You can check this example to add an attribute to the specific html element
@BabyBear thank you for you answer.
The problem here is that the radiobuttons are created dynamicly.
However i was thinking on similar approach using javascript, but try to move the attribute from the parent to child element.
The reason for posting here was to find a more native way of doing it :p
Yup, that is the approach i am trying right now, because that way the class is on the actual radiobutton.
Thank you!