我有一个如下所示的数据表:
<table><thead>
<tr>
<th><input type="checkbox" /></th>
<th scope="col">Foo</th>
<th scope="col">Bar</th><tr>
</thead>
<tbody>
<tr><td><input type="checkbox" /></td><td scope="row">a</td><td>b</td></tr>
<tr><td><input type="checkbox" /></td><td scope="row">c</td><td>d</td></tr>
</tbody></table>
我希望标题中的复选框选择正文中的所有复选框。我已经编写了 Javascript 来进行选择,它工作正常。但是,在 IE7 和 IE8 中(可能是其他浏览器,但我们不需要支持其他任何东西),标题中的复选框永远不会获得选项卡焦点,所以我们失败了 508。
有没有办法在不为所有内容设置 tabindexes 的情况下处理这个问题?