An easy select plugin for filterable select
- Add necessary .js and .css to your page (jQuery
1.7+
required)
<script src="FilterableSelect/filterableSelect.js"></script>
<link rel="stylesheet" href="FilterableSelect/css.css">
- Let's say you have a
<select>
that needs to be filterable
<select id="my-select"></select>
- Just call
MakeSelectFilterable
function on your jQuery object$my-select
<script type="text/javascript">
$('#my-select').MakeSelectFilterable(OnSelectChange);
//Optional callback
function OnSelectChange(selectElem) {
var option = $(selectElem).children('option:selected').text();
console.log('You have choosen an option: ' + option);
}
</script>