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
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<input class="starter" id="input" placeholder="input"/>
<h2>output:</h2>
<p class="starter" id="output"></p>
<p class="starter" id="line-1"></p>
<p class="starter" id="line-2"></p>
<p class="starter" id="line-3"></p>
<script>
document.querySelector('#input').addEventListener('change', function(event){
var currentInput = event.target.value;
Expand All @@ -16,4 +19,4 @@ <h2>output:</h2>
</script>
<script src="script.js"></script>
</body>
</html>
</html>
57 changes: 51 additions & 6 deletions script.js
Original file line number Diff line number Diff line change
@@ -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 <p> 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

};
};
3 changes: 2 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
display:block;
margin:40px;
border:3px solid blue;
background-color: pink;
}

#output{
background-color:pink;
}
}