From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:08:27 +0200 Subject: add: graphs et rushs --- graphs/js/counter/counter.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 graphs/js/counter/counter.js (limited to 'graphs/js/counter/counter.js') diff --git a/graphs/js/counter/counter.js b/graphs/js/counter/counter.js new file mode 100644 index 0000000..89198de --- /dev/null +++ b/graphs/js/counter/counter.js @@ -0,0 +1,12 @@ +const counter = document.getElementById("count"); +let counterVal = parseInt(counter.innerHTML); +const btnPlus = document.getElementById("plus"); +const btnMinus = document.getElementById("minus"); + +btnPlus.addEventListener("click", () => { + counter.innerHTML = ++counterVal; +}); + +btnMinus.addEventListener("click", () => { + counter.innerHTML = --counterVal; +}); -- cgit v1.2.3