How to make the first option of selected with jQuery


Code:
<select id="firstSelect">
    <option selected>All</option>
    <option value="Orange">Orange</option>
    <option value="Apple">Apple</option>
    <option value="Lemon">Lemon</option>
</select>

<select id="secondSelect">
    <option selected>All</option>
    <option value="Cat">Cat</option>
    <option value="Dog">Dog
    <option>
</select>
<script>
    $(document).ready(function () {
        $("#secondSelect").on('change', function () {

            $("#firstSelect").val($("#firstSelect option:first").val());

        });
    });
</script>

Comments