Jquery Chosen focus on page load (onLoad?)

后端 未结 8 1375
清酒与你
清酒与你 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:57

    If your using the first example (standard select box) you can use:

    jQuery(document).ready(function($) {
        $('.chzn-drop .chzn-search input[type="text"]').focus();
    })
    

提交回复
热议问题