我是靠谱客的博主 孝顺冬天,这篇文章主要介绍IE6不能修改NAME问题的解决方法,现在分享给大家,希望可以做个参考。

The NAME attribute cannot be set at run time on elements dynamically created with the createElement method.
To create an element with a name attribute, include the attribute and value when using the createElement method.
也就是说,你得这么写

复制代码 代码如下:

document.createElement('<input type="text" name="username" >');

看起来都觉得不爽,而且不支持FF.
如果你使用了Jquery的clone方法,然后想在复制之后修改元素的name属性,那是不会成功的,简单一点的办法是新建一个,然后删掉原来那个。
复制代码 代码如下:

$('<input type="text" name="username" />').appendTo(xxx.parent());
xxx.remove();

最后

以上就是孝顺冬天最近收集整理的关于IE6不能修改NAME问题的解决方法的全部内容,更多相关IE6不能修改NAME问题内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(188)

评论列表共有 0 条评论

立即
投稿
返回
顶部