Extends Select2 plugin by adding an option to set a placeholder for the dropdown 'search' input field.
Extends Select2 v4 plugin by adding an option to set a placeholder for the 'search' input field.
Demo available on JsFiddle.
Initialize the select2 plugin with the searchInputPlaceholder
option.
$("select").select2({
// options
searchInputPlaceholder: 'My custom placeholder...'
});
Include the script after Select2 main javascript file:
<script src="select2.js"></script>
<script src="select2-searchInputPlaceholder.js"></script>