diff --git a/app.js b/app.js index 5f2be35..6133041 100644 --- a/app.js +++ b/app.js @@ -25,3 +25,11 @@ for (const deleteButton of deleteButtons) { event.target.parentNode.remove() }) } + +const addButtons = document.querySelectorAll('button.add'); +for (const addButton of addButtons) { + addButton.addEventListener('click', (event)=>{ + const template = document.querySelector('template').content.children[0]; + event.target.parentNode.children[0].appendChild(template.cloneNode(true)) + }) +} diff --git a/index.html b/index.html index 984470c..83998d2 100644 --- a/index.html +++ b/index.html @@ -44,5 +44,14 @@ +