JavaScript COUNTER PROGRAM

6 Views
Published
00:00:00 Intro
00:00:27 HTML
00:02:16 CSS
00:05:58 JavaScript

// COUNTER PROGRAM
const increaseBtn = document.getElementById("increaseBtn");
const decreaseBtn = document.getElementById("decreaseBtn");
const resetBtn = document.getElementById("resetBtn");
const countLabel = document.getElementById("countLabel");
let count = 0;

increaseBtn.onclick = function(){
count++;
countLabel.textContent = count;
}
decreaseBtn.onclick = function(){
count--;
countLabel.textContent = count;
}
resetBtn.onclick = function(){
count = 0;
countLabel.textContent = count;
}
Category
Bro Code
Tags
javascript, javascript tutorial, javascript full course
Be the first to comment