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 af608eb6..e034f155 100644 --- a/dom-merge-conflict/tasks/buttons-and-counter/src/app.js +++ b/dom-merge-conflict/tasks/buttons-and-counter/src/app.js @@ -1,4 +1,10 @@ + +import { header } from "./header"; +import { main} from "./header"; + + //increments the number in a node's text + function increment(node) { let current = node.textContent; node.textContent = Number(current) + 1; @@ -7,18 +13,7 @@ function increment(node) { export function App() { const body = document.createElement("body"); - const header = document.createElement("header"); - header.innerHTML = ` -
A simple counter. Press increment to increase the count by one.
- `; - body.appendChild(header); - - const main = document.createElement("main"); - main.innerHTML = ` -0
- - `; + body.appendChild(header); body.appendChild(main); const button = body.querySelector("#increment"); 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 00000000..9884c3ee --- /dev/null +++ b/dom-merge-conflict/tasks/buttons-and-counter/src/header.js @@ -0,0 +1,6 @@ + +export const header = document.createElement("header"); + header.innerHTML = ` +A simple counter. Press increment to increase the count by one.
+ `; diff --git a/dom-merge-conflict/tasks/buttons-and-counter/src/main.js b/dom-merge-conflict/tasks/buttons-and-counter/src/main.js new file mode 100644 index 00000000..4f426724 --- /dev/null +++ b/dom-merge-conflict/tasks/buttons-and-counter/src/main.js @@ -0,0 +1,5 @@ +export const main = document.createElement("main"); +main.innerHTML = ` +0
+ + `;