我正在尝试使用 Prototype 的 New Element 函数构建一个表。当我用完整的内容更新 thead 时,我在 Firefox 中遇到了问题:所有元素加上内容。Firefox 正在剥离标签并仅显示内容。
无论如何,我决定构造每一个 th 元素,然后使用该Element.update()
函数将其附加到 thead 中。但我还没有找到用这个函数附加多个对象的方法。
第 th 个元素如下所示:
var thead_amount = new Element('th', {
'id': 'amount'
}).update('amount');
这工作正常:
new Element('thead').update(thead_amount);
这输出与上面相同:
new Element('thead').update(thead_amount, thead_pdf, thead_tags, thead_date, thead_options);
这输出[object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement][object HTMLTableCellElement]
new Element('thead').update(thead_amount + thead_pdf + thead_tags + thead_date + thead_options);
如何使用 Prototype 的update()
函数附加多个对象?
谢谢!