我想用Prototype的新元素函数构造一个表。当我用完整的内容更新thead时,我遇到了Firefox中的问题:所有元素和内容。 Firefox正在剥离标签并仅显示内容。Prototype Element.update多个对象
无论如何,我决定构造每一个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()
函数中附加多个对象?
谢谢!
我也尝试了innerHTML,但在Firefox中没有改变!thead应该是这样的: