Select menu not being restored when Back button used

后端 未结 6 904
予麋鹿
予麋鹿 2021-01-31 19:47

Consider a web page that has a select menu with a JavaScript event handler tied to the menu\'s onchange event that when fired reloads the page with a new query string (using the

6条回答
  •  误落风尘
    2021-01-31 20:12

    This jQuery code did the trick for me

    $(document).ready(function () {
        $("select").each(function () {
            $(this).val($(this).find('option[selected]').val());
        });
    })
    

提交回复
热议问题