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));
}
}
}