diff --git a/index.html b/index.html index 77832ae..dc7d7e5 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,9 @@

output:

+

+

+

- + \ No newline at end of file diff --git a/script.js b/script.js index 6582e0d..8ebc32c 100644 --- a/script.js +++ b/script.js @@ -1,11 +1,56 @@ console.log("hello script js"); +// What I need to do + +//1. a function to display a string to output + +//2. to check if user input is a number + +//3. make an array and record user input + +//4. run a loop for each array input + +//5. display a pineapple for each loop + +//6. create a new

for each user input + + + + + + + + + +//Variable to be shown when a number is entered +var pineApple = "🍍"; +//to +var countInput = []; + + +//this assigns a variable for function that runs when user enters a value var inputHappened = function(currentInput){ + //this logs the entered value into the console console.log( currentInput ); - display( "WOW SOMETHING HAPPENED" ); -}; + //boolean argument before returning + if (isNaN(currentInput)){ + console.log("that is not a number"); + alert("That is not a number"); + return + } + console.log("that is a number"); + display() +} + + +// your DOM manipulation code here +var display = function(outputBox){ + + //This searches for the p element output in the html document and change the text + outputBox = document.getElementById("output"); + + output.innerHTML = "Heres a 🍍"; + + console.log(); -var display = function(stuffToDisplay){ - // your DOM manipulation code here - -}; + }; \ No newline at end of file diff --git a/style.css b/style.css index 282077b..5b889c1 100644 --- a/style.css +++ b/style.css @@ -4,8 +4,9 @@ display:block; margin:40px; border:3px solid blue; + background-color: pink; } #output{ background-color:pink; -} +} \ No newline at end of file