源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2021-11-09 11:59 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要: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. 也就是说,你得这么写
[u]复制代码[/u] 代码如下:
document.createElement('<input type="text" name="username" >');
看起来都觉得不爽,而且不支持FF. 如果你使用了Jquery的clone方法,然后想在复制之后修改元素的name属性,那是不会成功的,简单一点的办法是新建一个,然后删掉原来那个。
[u]复制代码[/u] 代码如下:
$('<input type="text" name="username" />').appendTo(xxx.parent()); xxx.remove();
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部