假设我们有一个 DOM:
... <div> // child nodes </div> <div id="needsToNotBeFocusable"> // child nodes </div> ...
有没有办法使其<div id="needsToNotBeFocusable">及其子节点不可聚焦?
<div id="needsToNotBeFocusable">
tabindex="-1"每个子节点上的设置都会破坏已经存在的选项卡索引。
tabindex="-1"
html javascript css
css ×1
html ×1
javascript ×1