Home  >  Article  >  Web Front-end  >  Solution to the problem that IE6 cannot modify the name_javascript skills

Solution to the problem that IE6 cannot modify the name_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:20:22884browse

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.
That is, you have to Write like this

Copy the code The code is as follows:

document.createElement('');

It doesn't look good, and it does not support FF.
If you use Jquery's clone method, and then want to copy Modifying the name attribute of the element will not succeed. The simpler way is to create a new one and then delete the original one.
Copy code The code is as follows:

$('').appendTo(xxx.parent());
xxx.remove();
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn