Wondering if it’s possible to inject a custom attribute to the bootstrap controls.
e.g.
Wondering if it’s possible to inject a custom attribute to the bootstrap controls.
e.g.
Here’s one way, assuming you have a BS input control named Input1.
To set it:
Input1.setAttribute('customname', 'value')
To get it:
Input2.getAttribute('customname') 'returns "value"
Kind regards,
Doug
You seem to be mixing BASIC and JavaScript. This will work in both:
Input1.setAttribute("customname", "value")
Input2.getAttribute("customname")
Thanks for fixing that George. Actually, I just forgot to use double-quotes around the key/value pair. The ‘returns…’ part was intended to be a BASIC comment.
Doug
In case anyone else wants to use Vue (there may be other ways). I had already looked at setAttribute. The issue was I had already created my Vue object. So I just needed to rearrange my code.