Input autofocus attribute

后端 未结 10 1522
Happy的楠姐
Happy的楠姐 2020-11-30 04:47

I have places in my code where I have this:


I would like to be able to use it like

10条回答
  •  再見小時候
    2020-11-30 05:38

    What I did is using regular autofocus on my inputs:

    And then I set the focus on the first visible input with autofocus when angular is ready:

    angular.element(document).ready(function() {
      $('input[autofocus]:visible:first').focus();
    });
    

    Hope this helps.

提交回复
热议问题