Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,10 @@ body {
}

@media (width >= 500px) {
}
.app-card {
display: flex;
flex-direction: row;
max-width: 500px;
flex: 1;
}
}
30 changes: 7 additions & 23 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"using strict";
"use strict";

let count = 0;

Expand All @@ -9,53 +9,37 @@ const decrementBtn = document.querySelector(".decrement-btn");


function incrementCount() {
// Write the relevant code in this block

++ count; //increase count by 1
}


function decrementCount() {
// Write the relevant code in this block

-- count; //decrease count by 1
}


function resetCount() {
// Write the relevant code in this block

count = 0; //reset counter to 0
}

function renderUpdatedCount() {
countElement.innerText = count;
}

incrementBtn.addEventListener("click", function () {
// Write code below this line



// STOP HERE

++ count;

renderUpdatedCount();
});

resetBtn.addEventListener("click", function () {
// Write code below this line


// STOP HERE

count = 0;

renderUpdatedCount();
});

decrementBtn.addEventListener("click", function () {
// Write code below this line


// STOP HERE

--count;

renderUpdatedCount();
});
10 changes: 9 additions & 1 deletion quiz.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
1. Why do you use "using strict" at the top of your JS files?
It helps write cleaneer code and catch mistakes faster.

2. What does line 3 mean?
It sets the initial count to zero

3. What is happening on lines 5-8 and why?
Creates variables , then goes to teh HTML code and looks for an element with the same
class as stated. It then stores them in the variables.

4. If you implemented the functionality of the buttons,
why do you think I wrote the JS code the way I did?
why do you think I wrote the JS code the way I did?
I don't really know...Maybe for readability?