【发布时间】:2012-08-01 04:18:30
【问题描述】:
我在这样的表格中有多行 http://jsfiddle.net/mm6gF/1/ 。
我想在消息中显示前 2 个 td 的内容。如何使用 jQuery 获取它?
【问题讨论】:
标签: jquery fetch html-table
我在这样的表格中有多行 http://jsfiddle.net/mm6gF/1/ 。
我想在消息中显示前 2 个 td 的内容。如何使用 jQuery 获取它?
【问题讨论】:
标签: jquery fetch html-table
$('.delete').click(function() {
var name = $(this).closest('tr').find('td').first().text();
var pw = $(this).closest('td').prev().text();
answer = confirm ('Are you sure to remove this item?\n' + name + ' : ' + pw);
if (answer)
{
alert('Removed');
}
});
【讨论】: