body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.counter {
text-align: center;
}
button {
padding: 8px 16px;
margin: 0 8px;
font-size: 16px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
Counter App
Click the buttons to increase or decrease the count:
Count: 0
let count = 0;
const countElement = document.getElementById(‘count’);
function increaseCount() {
count++;
countElement.textContent = count;
}
function decreaseCount() {
count–;
countElement.textContent = count;
}
Belajar di Course JWD -> https://bagascodingasik.com