Jquery Chosen focus on page load (onLoad?)

后端 未结 8 1374
清酒与你
清酒与你 2020-12-20 11:59

I\'m using the Jquery Chosen plugin on a select box, however I\'d like to focus this on page load. I\'ve used the following code to focus a text input:

onLoa         


        
相关标签:
8条回答
  • 2020-12-20 13:05

    In Chosen 1.0, this command is now:

    $('.my_select_box').trigger('chosen:activate');
    

    See here.

    0 讨论(0)
  • 2020-12-20 13:05

    This fixes the issue completely for me:

    $('.chzn-drop .chzn-search input[type="text"]').focus();
    $('.chzn-container').addClass('chzn-container-active');
    
    0 讨论(0)
提交回复
热议问题