JavaScript中为元素加上name属性的方法

qq_18749 14 0 PDF 2020-12-13 08:12:14

今天遇到个小问题, 在构建 DOM 时, IE 中不能通过 element.setAttribute(‘name’, _variable); 和 element.name = _variable; 这样的形式来为元素加上 name 属性, 无论是 IE6 还是 IE7. (IE8 是可以的, 但 IE8rc1 不行) 后来我查看了 MSDN, 得到信息如下: 代码如下: Internet Explorer 8 and later can set the NAME attribute at run time on elements dynamically created with the cr

用户评论
请输入评论内容
评分:
暂无评论