The beginnings.
This commit is contained in:
parent
cec2d56eca
commit
4615c296b3
3 changed files with 83 additions and 0 deletions
10
js/add_choice.js
Normal file
10
js/add_choice.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
const add_choice = () => {
|
||||
let index = document.getElementsByClassName("choice").length;
|
||||
|
||||
|
||||
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}`;
|
||||
document.getElementById("choices").appendChild(clone);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue