firing a jQuery change function at document ready

后端 未结 4 1545
醉酒成梦
醉酒成梦 2021-02-02 12:01

My change function allows users to switch from country to country and get different text and features. It works when changing country selections. But at initial page load, it do

4条回答
  •  眼角桃花
    2021-02-02 12:38

    Why not just trigger change after selecting the appropriate radio buttons?

    $('input[name=country]').change();
    

    This is equivalent to

    $('input[name=country]').trigger('change');
    

提交回复
热议问题