I\'ve seen a lot examples of Select2 option tags set with \"data-\" attributes and I would like to do it.
Select2
I\'m using ajax to get the data. I get the
I am not sure what exactly you are asking but if you want to add data attribute you can do like this..
In Jquery:
$(element).attr('data-info', '222');
In javascript:
document.getElementById('elementId').setAttribute('data',"value: 'someValue'");