How to blur the first form input at the dialog opening

后端 未结 6 1775
花落未央
花落未央 2021-01-13 23:33

I have a jQuery.dialog who show a form.
The first input is and I init the datepicker like this jQue

6条回答
  •  轮回少年
    2021-01-14 00:24

    Starting from jQuery UI 1.10.0, you can choose which input element to focus on by using the HTML5 attribute autofocus.

    All you have to do is create a dummy element as your first input in the dialog box. It will absorb the focus for you.

    
    

    This has been tested in Chrome, Firefox and Internet Explorer (all latest versions) on February 7, 2013.

    http://jqueryui.com/upgrade-guide/1.10/#added-ability-to-specify-which-element-to-focus-on-open

提交回复
热议问题