$(this).closest('tr').next() td:eq(7).focus();
这是什么错误?我是jQuery的新手。我如何使用tr
,td
和table
索引进行对焦?focus使用jquery <tr>
$('.gridfield').keypress(function(e) {
console.log(this);
if (e.which == 13) {
var row_index = $(this).parent().index();
$(this).closest('tr').next() td:eq(row_index).focus();
e.preventDefault();
}
});
'$(本).closest( 'TR')的next()找到( 'TD')当量(ROW_INDEX).focus(); ' –
没有工作......对于这个......的任何其他解决方案? – Bipin
你想做什么?分享你需要的html样本 –