diff --git a/css/style.css b/css/style.css index c10d2b4..04a557d 100644 --- a/css/style.css +++ b/css/style.css @@ -66,4 +66,10 @@ body { } @media (width >= 500px) { -} + .app-card { + display: flex; + flex-direction: row; + max-width: 500px; + flex: 1; + } +} \ No newline at end of file diff --git a/js/app.js b/js/app.js index db2cc94..6c0377f 100644 --- a/js/app.js +++ b/js/app.js @@ -1,4 +1,4 @@ -"using strict"; +"use strict"; let count = 0; @@ -9,20 +9,17 @@ 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() { @@ -30,32 +27,19 @@ function renderUpdatedCount() { } 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(); }); diff --git a/quiz.txt b/quiz.txt index 86fee07..049f196 100644 --- a/quiz.txt +++ b/quiz.txt @@ -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? \ No newline at end of file + why do you think I wrote the JS code the way I did? + I don't really know...Maybe for readability? \ No newline at end of file