diff --git a/mario.html b/mario.html index 28b1c88..a395f81 100644 --- a/mario.html +++ b/mario.html @@ -1,13 +1,18 @@ - + Beautiful pyramid

Mario 1

+
+ + +

Want to see a beautiful pyramid? Open up the developer tools and look at the Console.

+ diff --git a/mario.js b/mario.js index 2adfb74..00cf6fa 100644 --- a/mario.js +++ b/mario.js @@ -1,6 +1,11 @@ -printPyramid(5); - +/* Add Event Listener to the button */ + const button = document.querySelector("button"); + const input = document.querySelector("input"); + button.addEventListener("click", function () { + if(input.value) + printPyramid(input.value); + }, false); /* * printPyramid @@ -14,6 +19,7 @@ printPyramid(5); * ###### */ function printPyramid(height) { + console.log(height); console.log("Uh oh... the pyramid is under construction."); console.log("Check back soon, our developers are hard at work as we speak!");