Vue v-model binding


Wondering if it’s possible to inject a custom attribute to the bootstrap controls.



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,


You seem to be mixing BASIC and JavaScript. This will work in both:

Input1.setAttribute("customname", "value")



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.



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.