diff --git a/js/add_choice.js b/js/add_choice.js index 1418ee4..62e0e8f 100644 --- a/js/add_choice.js +++ b/js/add_choice.js @@ -4,8 +4,8 @@ const add_choice = () => { let choice_div = document.getElementById("choice-template"); let clone = choice_div.content.cloneNode(true); - clone.childNodes[1].childNodes[1].id = `text-in-${index}`; - clone.childNodes[1].childNodes[3].id = `weight-in-${index}`; + clone.children[0].children[0].id = `text-in-${index}`; + clone.children[0].children[1].id = `weight-in-${index}`; // Add to document without resetting the other ones document.getElementById("choices").appendChild(clone);