jQueryでは、keydownイベントを使用できます。次のコードはここでライブで表示できます:http://jsfiddle.net/TXZWC/26/
HTML:
<select name="companies">
<option value="">choose</option>
<option value="1" data-search-match="AABE">(AABE) Able Air Conditioning</option>
<option value="2" data-search-match="BAE">(BAE) Bark Air Equipment</option>
</select>
<a id="clear-search" href="#">Clear Search</a>
JS:
$(document).ready(function(){
var $select = $('select'),
searchQuery = '';
$(document).on('keydown', function (e){
// get the char value and append to search string
searchQuery += String.fromCharCode(e.which);
// unselect previously selected option
deselectSelectedOption();
// find matching option
var $selected = $select.find('option').filter(function(){
return $(this).data('search-match') === searchQuery;
});
if($selected){
$selected.attr('selected', 'true');
}
});
$('#clear-search').click(function(e){
e.preventDefault();
searchQuery = '';
deselectSelectedOption();
$select.find('option').first().attr('selected', 'true');
});
function deselectSelectedOption(){
$select.find('option[selected]').removeAttr('selected');
}
});