Answers for "jquery how to filter dropdown"

0

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>
Posted by: Guest on October-09-2021
0

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>
Posted by: Guest on October-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language