$.focus() not working

后端 未结 14 1207
走了就别回头了
走了就别回头了 2020-11-27 02:48

The last example of jQuery\'s focus() documentation states

$(\'#id\').focus()

should make the input focused (active). I can\'t seem to get

14条回答
  •  面向向阳花
    2020-11-27 03:09

    Found a solution elsewhere on the net...

    $('#id').focus();
    

    did not work.

    $('#id').get(0).focus();
    

    did work.

提交回复
热议问题