Load data on Select2 | Jquery
Krixnaas
Posted on April 29, 2022
var data = [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2,
text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }];
$("#controlID").select2({
data: data
})
💖 💪 🙅 🚩
Krixnaas
Posted on April 29, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Why Does jQuery or a DOM Method Like `getElementById` Fail to Find an Element?
November 22, 2024