首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

document.createElement("<img>")在FireFox中不能用么,该如何处理

2012-02-23 
document.createElement(img)在FireFox中不能用么document.createElement( img)在FireFox中不能

document.createElement("<img>")在FireFox中不能用么
document.createElement( " <img> ")在FireFox中不能用么
那应该怎么动态创建对象,要在FireFox中支持

[解决办法]
FireFox中支持
var input = document.createElement( "input ");
input.type= "submit ";
input.value= "提交 ";

//一定要应用到页面上
//下面是直接放在页面的body下
document.body.appendChild(input);

热点排行