focus() doesn't work inside colorbox pop-up

前端 未结 6 1755
遇见更好的自我
遇见更好的自我 2021-02-14 11:43

I tried to use focus for first input field on the form. but it doesn\'t work. When I call attr(\"id\") for that input it worked. When I call focus f

6条回答
  •  無奈伤痛
    2021-02-14 12:39

    Try the first selector,

    $("form input:first").focus();
    

    http://jsfiddle.net/erick/mMuFc/

提交回复
热议问题