Sorry!! Once again:
Yes, code works at all.
$('#selectkk').load('JSON/kk_select_box.php?' + $.param({
kk: encodeURIComponent(''),
plz: encodeURIComponent(''),
ort: encodeURIComponent(''),
}),
// callback function after selectbox has load
function(){
var i, filter,
$input = $('#ort_kk'),
$options =$('#select_kk').find('option')
$input.keyup(function(){
filter = $input.val()
$options.each(function(){
var option_text=$(this).text();
var pos = option_text.search(filter);
if( pos == -1 ){
$(this).remove(); }
})
});
}
);
But nevertheless, this won’t work:
...
if (pos == -1) {
$(this).hide();
} else {
$(this).show();
}
...