DEV Community

Krixnaas
Krixnaas

Posted on

Load data on Select2 | Jquery

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
    })
Enter fullscreen mode Exit fullscreen mode

Top comments (0)