1 function filter() {
2 var keyword = document.getElementById("search").value;
3 var select = document.getElementById("select");
4 for (var i = 0; i < select.length; i++) {
5 var txt = select.options[i].text;
6 if (!txt.match(keyword)) {
7 $(select.options[i]).attr('disabled', 'disabled').hide();
8 } else {
9 $(select.options[i]).removeAttr('disabled').show();
10 }
11
12 }
13 }