Created
November 6, 2017 22:49
-
-
Save thrasibule/3e498a1ca1850640e10d11fd1832447a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$("#btn_plus").click(function() { | |
$(this).remove(); | |
var t = document.getElementById("fragment").cloneNode(true), | |
labels = t.content.querySelectorAll("label"); | |
for (var i = 0; i < labels.length; i++ ) { | |
labels[i].setAttribute("for", labels[i].getAttribute("for") + "-" + "2"); | |
} | |
var clone = document.importNode(t.content, true); | |
document.getElementById("outgoing").appendChild(clone); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment