javascript:如何在greatemonkey/prototype中向表中添加列

javascript: How to add a column to a table in greasemonkey/prototype?

本文关键字:添加 prototype greatemonkey javascript      更新时间:2023-09-26

我想使用Greasemonkey和javascript增强html页面。

这是我的目标:在表的每个元素的最后一个单元格后面添加一个额外的单元格

页面已经在使用原型(因此我们可以使用原型)

您想做的是在每行中添加一个单元格,对吗?如果是这样的话:

原型.js:

$$("tr").each(function(tr){ 
    $(tr).insert('<td>Content of the new cell</td>') 
})

jQuery:

$("tr").append("<td>Content of the new cell</td>")