While using select2 library, if you have to find the selected and unselected item based on the change event when you check or uncheck the items. Based on the checked status, you may have to create some custom trigger or events then you can use the below code reference from codepen to achieve the save.

 

See the Pen
How to find selected and unselected item in select2 dropdown
by Vinod (@phpweblamp)
on CodePen.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.