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