Jquery Chosen focus on page load (onLoad?)

后端 未结 8 1453
清酒与你
清酒与你 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 12:47

    
    
    ...
    
          $("#myselect_chzn").children('.chzn-drop').children('.chzn-search').children('input[type="text"]').focus();
          $("#myselect_chzn").addClass('chzn-container-active');
    

    Chosen creates owns divs and converts your "select_ID" into "select_ID_chzn" for those divs

提交回复
热议问题