JS Clone ID Object After how to modify ID value of the following element

Source: Internet
Author: User
JS Clone ID Object After how to modify ID value of the following element
This post was last edited by qq_28513445 on 2015-05-26 23:40:28





<title>Untitled Document</title>





Image 1 Address:

Photo 1 Links:




Add a picture
Delete a picture
Generate Code





above is I write only change the parent ID code, not write can also modify the child element ID value code, may I express unclear, look at the following code, is to do the following




<title>Untitled Document</title>





Image 1 Address:

Photo 1 Links:




Image 2 Address:

Photo 2 Links:


Image 3 Address:

Photo 3 Links:





Add a picture
Delete a picture
Generate Code






------to solve the idea----------------------
Can't write? Then you're clear.
You're actually going to write it.
function TJs () {
var Sourcenode = $ ("Tps_" +ZHS);

zhs=zhs+1;
var vbn= "Tps_" + zhs
Clonednode.setattribute ("id", VBN);

var o = clonednode.childnodes;
for (i=0; i
if (O[i].nodename = = ' INPUT ') {
O[i].setattribute ("id", O[i].getattribute ("id"). Replace (/\d+/, ZHS));
}
}


}
  • 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.