如何使用表格单元格捕获按键事件 - Web辅助功能?

问题描述 投票:1回答:1

我有启用辅助功能的Web应用程序

在单元格表格中,我有屏幕阅读器JAWS正在读取的数据。在相同的单元格上,我有菜单,在输入按键时激活。我没有在单元格上定义任何角色。其结果如下:

问题1.输入按键转换为鼠标点击事件Jaws这样做,因为没有Jaws ON,它的工作正常。所以如何让Enter键在这里工作。我有两个不同的菜单,鼠标点击打开,然后输入按键。

下面是示例代码,当钳口打开时,输入按键成为点击事件。

    <!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){



     $( "td" ).click(function() {
     alert( "Handler for .click() called." );
    });

    $("td").keydown(function(e){
        if(e.which == 13) {
        alert('You pressed enter!');
      }

    });



});
</script>
</head>
<body>

<table> 
  <tbody>
  <tr>
    <th>Parameter</th>
    <th>Description</th>
  </tr>  
  <tr>
    <td tabindex="0" >function</td>
    <td>Specifies </td>
  </tr>
  <tr>
    <td>function2</td>
    <td>Optional.</td>
  </tr>
  </tbody>
  </table>

</body>
</html>

intial table


After mouse click

accessibility jaws-screen-reader
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.