作家
登录

IE6不能修改NAME问题的解决方法

作者: 来源:www.28hudong.com 2013-03-30 01:20:28 阅读 我要评论

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();

  推荐阅读

  来自腾讯的一个不固定高度得消息的滚动特效

#msg_weibo {width:300px;height:186px;*height:186px;_height:170px;margin:10px auto 0;zoom:1; overflow:hidden;font-size:12px;line-height:20px;margin-bottom:4px;background:#ffffff;} #msg_>>>详细阅读


本文标题:IE6不能修改NAME问题的解决方法

地址:http://www.17bianji.com/kaifa2/JS/25776.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)