Solution to the NAME issue cannot be modified in IE6

Source: Internet
Author: User

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 to say, you have to write
Copy codeThe Code is as follows:
Document. createElement ('<input type = "text" name = "username"> ');

It seems uncomfortable and does not support FF.
If you use the Jquery clone method and want to modify the name attribute of the element after copying, it will not be successful. simply create a new one and delete the original one.
Copy codeThe Code is as follows:
$ ('<Input type = "text" name = "username"/>'). appendTo (xxx. parent ());
Xxx. remove ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.