jQuery .focus doesn’t actually focus a newly created element

后端 未结 8 1894
清歌不尽
清歌不尽 2020-12-08 03:38

Let’s say I have this markup:

First paragraph

8条回答
  •  情歌与酒
    2020-12-08 03:55

    I think the main answer is incorrect. DIV and P tags can receive focus providing you specify a tabindex property for them. i.e.

    Once the tabindex is specified you can either tab to these elements or shift focus with .focus() .

    Using a scrollTo plugin seems like a bit of an overkill here.

提交回复
热议问题