diff --git a/individual/frontend/s02/.gitignore b/individual/frontend/s02/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/individual/frontend/s02/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/individual/frontend/s02/counter.js b/individual/frontend/s02/counter.js new file mode 100644 index 0000000..881e2d7 --- /dev/null +++ b/individual/frontend/s02/counter.js @@ -0,0 +1,9 @@ +export function setupCounter(element) { + let counter = 0 + const setCounter = (count) => { + counter = count + element.innerHTML = `count is ${counter}` + } + element.addEventListener('click', () => setCounter(counter + 1)) + setCounter(0) +} diff --git a/individual/frontend/s02/index.html b/individual/frontend/s02/index.html index 58a8957..18b584e 100644 --- a/individual/frontend/s02/index.html +++ b/individual/frontend/s02/index.html @@ -1,10 +1,16 @@ + -
- - + + + + +