diff --git a/dom-merge-conflict/tasks/buttons-and-counter/src/app.js b/dom-merge-conflict/tasks/buttons-and-counter/src/app.js index af608eb..25be5bd 100644 --- a/dom-merge-conflict/tasks/buttons-and-counter/src/app.js +++ b/dom-merge-conflict/tasks/buttons-and-counter/src/app.js @@ -12,20 +12,4 @@ export function App() {
A simple counter. Press increment to increase the count by one.
`; - body.appendChild(header); - - const main = document.createElement("main"); - main.innerHTML = ` -0
- - `; - body.appendChild(main); - - const button = body.querySelector("#increment"); - const counter = body.querySelector("#counter"); - button.addEventListener("click", () => { - increment(counter); - }); - - return body; -} + \ No newline at end of file diff --git a/dom-merge-conflict/tasks/buttons-and-counter/src/header.js b/dom-merge-conflict/tasks/buttons-and-counter/src/header.js new file mode 100644 index 0000000..b4bd067 --- /dev/null +++ b/dom-merge-conflict/tasks/buttons-and-counter/src/header.js @@ -0,0 +1,17 @@ + body.appendChild(header); + + const main = document.createElement("main"); + main.innerHTML = ` +0
+ + `; + body.appendChild(main); + + const button = body.querySelector("#increment"); + const counter = body.querySelector("#counter"); + button.addEventListener("click", () => { + increment(counter); + }); + + return body; +} diff --git a/dom-merge-conflict/tasks/buttons-and-counter/src/src b/dom-merge-conflict/tasks/buttons-and-counter/src/src new file mode 100644 index 0000000..e69de29