从myModal
中删除tabindex="-1"
似乎可以完成任务:小提琴
Removing tabindex="-1"
from myModal
seems to do the job: Fiddle
问题是tabindex
,因为如果将其设置为-1
,则将无法访问该元素.
更多信息此处,以及此
The problem is tabindex
, because if you set it to -1
, you won't be able to access that element.
More info here, and in this question.