【发布时间】:2015-01-03 12:36:03
【问题描述】:
我一直在尝试在 jQuery 中编写一个选择器,该选择器在表中第一个 tr 的倒数第二个 td 中选择一个带有类的按钮。到目前为止,这是我想出的:
$(':button.jtable-edit-command-button tr:first td:nth-last-of-type(2)').trigger('click');
但它不起作用。
我也试过这个:
$(':button.jtable-edit-command-button:td:nth-last-of-type(2):tr:first').trigger('click');
但我收到一条错误消息:
Syntax error, unrecognized expression: unsupported pseudo: td
这是我用来寻求帮助的 JS Fiddle 和 this W3 Schoosls tutorial。非常感谢所有帮助和建议。
【问题讨论】:
标签: javascript jquery html css jquery-selectors