我有一个表行的click函数,需要传递行中前两个tds的内容.
// Assign a click handler to the rows
$('#supportTables1 tr').click(function ()
{
var firstTd = $(this).find('td').html();
//need to get the next td. below line doesn't work.
var secondTd = $(this).find('td')[1].html();
window.open('snglContactList.php'+'?search_word='+firstTD+'?list_name=secondTd);
});
Run Code Online (Sandbox Code Playgroud)
我可以得到第一个td就好了,但是我很难理解我确定访问第二个td非常简单的问题(我尝试过设置它的索引的不同方法).