select2 select using optional data code example
Example: select2 placeholder
$(".js-example-placeholder-single").select2({
placeholder: "Select a state",
allowClear: true
});
$(".js-example-placeholder-single").select2({
placeholder: "Select a state",
allowClear: true
});