add button to delete trait
This commit is contained in:
parent
a945eb9f6b
commit
8451100415
@ -7,6 +7,7 @@
|
|||||||
<input class="name_input" value="{{trait['name']}}">
|
<input class="name_input" value="{{trait['name']}}">
|
||||||
<p> Description: </p>
|
<p> Description: </p>
|
||||||
<input class="desc_input" value="{{trait['desc']}}">
|
<input class="desc_input" value="{{trait['desc']}}">
|
||||||
|
<button onclick="deleteTrait(this)">Delete trait</button>
|
||||||
</section>
|
</section>
|
||||||
{%endfor%}
|
{%endfor%}
|
||||||
</section>
|
</section>
|
||||||
@ -26,6 +27,11 @@ function addNewInput(){
|
|||||||
traits.appendChild(newTrait);
|
traits.appendChild(newTrait);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteTrait(buttonNode){
|
||||||
|
let traitNode = buttonNode.parentNode;
|
||||||
|
traitNode.parentNode.removeChild(traitNode);
|
||||||
|
}
|
||||||
|
|
||||||
function saveForm(){
|
function saveForm(){
|
||||||
let data = [];
|
let data = [];
|
||||||
for(let section of traits.querySelectorAll("section")){
|
for(let section of traits.querySelectorAll("section")){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user