jquery how to filter dropdown
<script>
$(function () {
$('#country').on('change', function () {
let val = this.value;
console.log(val)
$('#state option').hide().filter(function () {
return this.value.indexOf(val) === 0;
})
.show();
})
.change();
});
</script>