有什么东西阻止这个工作,我正在动态地向表中添加一行,然后如果他们点击新行(或表中的任何行)它应该消失......但它不起作用?
$('.addtocart').click(function(){
var omPartNo = $(this).next().text();
var supPartNo = $(this).next().next().text();
var cat = $(this).next().next().next().text();
var desc = $(this).next().next().next().next().text();
var manuf = $(this).next().next().next().next().next().text();
var list = $(this).next().next().next().next().next().next().text();
var disc = $(this).next().next().next().next().next().next().next().text();
var priceEach = $(this).next().next().next().next().next().next().next().next().text();
$('#cart table').append('<tr class="tableRow"><td><a class="removeItem" href="#"><img src="/admin/images/delete.png"></img></a><td>' + omPartNo + '</td><td>' + supPartNo + '</td><td>' + cat + '</td><td>' + desc + '</td><td>' + manuf + '</td><td>' + list + '</td><td>' + disc + '</td><td>' + priceEach + '</td></tr>');
});
$('.tableRow').click(function(){
$(this).remove();
});