昨天在项目中发现IE6动态生成的INPUT是不能改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" >');