What would be the best way to reset the selected item to default? I\'m using Select2 library and when using a normal button type=\"reset\", the value i
type=\"reset\"
Sometimes I want to reset Select2 but I can't without change() method. So my solution is :
function resetSelect2Wrapper(el, value){ $(el).val(value); $(el).select2({ minimumResultsForSearch: -1, language: "fr" }); }
Using :
resetSelect2Wrapper("#mySelectId", "myValue");