出于某种原因,使用 Jquery 单击无法使用 Electron 中的表 TD
元素。它在 Chrome 浏览器中运行良好,但在 Electron 应用程序中运行不佳。所有其他元素都很好,例如 div、li、span、button
等...只有 td
不起作用。
<td class="td">Test</td>
$('.td').click(function (e) {
console.log('test');
});
有什么想法吗?
Electron 版本5.0.1。
Chrome 版本73.0.3683.121
最佳答案
这是因为 td
标签应该位于真实的表格上(应该有 tr
和 table
父标签)。像这样:
<table>
<tr>
<td class="td">Test</td>
</tr>
<tr>
<td class="td">Test</td>
</tr>
</table>
如果 td
标记位于 tr
之外,Chrome 将为它们创建 tr
标记。但 Electron 没有。
关于javascript - Electron Jquery click 不适用于表格元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56471603/