html中:<div id="aaa"></div>如何通过js往div中添加?(并不是往文件中添加,而是浏览时加入到aaa中)
<iframe>………………</iframe>我尝试过的方法,
var bbb=document.createElement('<iframe>………………</iframe>');
document.getElementById('aaa').appendChild(bbb);但是连火狐都不兼容,希望求得正解~!!!
<iframe>………………</iframe>我尝试过的方法,
var bbb=document.createElement('<iframe>………………</iframe>');
document.getElementById('aaa').appendChild(bbb);但是连火狐都不兼容,希望求得正解~!!!
f.setAttribute("src","http://www.baidu.com");
f.setAttribute("width","600px");
f.setAttribute("height:","500px");
document.body.appendChild(f);
//FF3.5
不知道可以不用appendChild这个方法不?因为要加入的太多了,变动也麻烦了~~