我试图抓住图像右侧的td =“description”标题/标题的内容 - 在表格中细胞。
然后将它添加到img下面并继续与之前相同的流程。
到目前为止,我有:
<script>
$('tr').each(function() {
var desc = $(this).$('td.description').html()
$(this).$('td.image').append(desc);
$('td.description').remove();
});
$("table#shopping-cart-items tr td.image").after($('<td id="clearSpace"></td>'));
});
</script>
如果我参加了“这个”了 - 它正确抓住它,并附加 - 但所有的名字都一样;所以我使用$(this)我假设是打破它,我还添加了$('tr')。每个函数?
谢谢您的时间!
为什么不按照想要的方式构建HTML? – Mikey