From 9750eeaba748f4ccfcf7f56f0848a48bc42075f0 Mon Sep 17 00:00:00 2001 From: Israel-Asidere <52455381+Israel-Asidere@users.noreply.github.com> Date: Fri, 25 Nov 2022 13:54:30 +0100 Subject: [PATCH] simple counter --- week 9/Israel/comments.md | 0 week 9/Israel/simplecounter.js | 15 +++++++++++++++ week 9/Israel/simplecounter.md | 10 ++++++++++ 3 files changed, 25 insertions(+) create mode 100644 week 9/Israel/comments.md create mode 100644 week 9/Israel/simplecounter.js create mode 100644 week 9/Israel/simplecounter.md diff --git a/week 9/Israel/comments.md b/week 9/Israel/comments.md new file mode 100644 index 0000000..e69de29 diff --git a/week 9/Israel/simplecounter.js b/week 9/Israel/simplecounter.js new file mode 100644 index 0000000..6a9206e --- /dev/null +++ b/week 9/Israel/simplecounter.js @@ -0,0 +1,15 @@ +import $ from 'jquery' + +const rootApp = document.getElementById('root') +rootApp.innerHTML = `
+

button count: 0

+ +
` +var count = 0 +var button = document.getElementById('mainButton') +var number = document.getElementById('btncount') + +button.onclick = function () { + count += 1 + number.innerHTML = count +} diff --git a/week 9/Israel/simplecounter.md b/week 9/Israel/simplecounter.md new file mode 100644 index 0000000..5fadc3b --- /dev/null +++ b/week 9/Israel/simplecounter.md @@ -0,0 +1,10 @@ +--- +Author: Israel +Date: 2022-11-25 +--- + +JavaScript Simple Counter + +We provided some simple JavaScript code. Your goal is to modify the application so that the counter correctly displays and it increments by one whenever the button is pressed. You are free to add classes and styles, but make sure you leave the element ID's as they are. + +Submit your code once it is complete and our system will validate your output. \ No newline at end of file