Closed quackadillyblip closed 8 years ago
How can i clear a selected value programmatically via jquery?
i tried something like this? $(this).find(".select2-selection__clear").click();
$(this).find(".select2-selection__clear").click();
but this doesn't seem to do it? any suggestions?
fixed; $(this).select2().val("").trigger("change");
$(this).select2().val("").trigger("change");
This is worked for me-
$('#accessories').val('').trigger("change"); //#accessories is the id of select2
How can i clear a selected value programmatically via jquery?
i tried something like this?
$(this).find(".select2-selection__clear").click();
but this doesn't seem to do it? any suggestions?