如何更改对象的HTML?

时间:2015-10-18 10:33:33

标签: javascript

我有infoTab.elements[1]抓住的对象。

这是对象Object { type="html", html="or<hr>"}

如何更改DOM中的object.html?

1 个答案:

答案 0 :(得分:1)

infoTab.elements[1]; // Object { type="html",  html="or<hr>"} 

console.log(infoTab.elements[1].html); // or<hr>

infoTab.elements[1].html = "2<hr>";

console.log(infoTab.elements[1].html); // 2<hr>