Skip to content
Open
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
42 changes: 34 additions & 8 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
console.log("hello script js");
console.log("DRAW THIS THROUGH DOM MANIPULATION!");

var inputHappened = function(currentInput){
console.log( currentInput );
display( "WOW SOMETHING HAPPENED" );
};
function clearInput() {
document.getElementById("input").value = "";
}

var fruit = "🍍";
var storeInput = 0;
var showOutput = "";

var display = function(stuffToDisplay){
// your DOM manipulation code here

var inputHappened = function(currentInput) {
var storeInput = currentInput;
clearInput();
console.log(storeInput);
if (!isNaN(parseInt(storeInput)) && storeInput < 10) {
for (i = 0; i < storeInput; i++) {
showOutput = showOutput + fruit;
console.log(showOutput);
}
var display = document.createElement("p");
display.innerText = showOutput;
document.getElementById("output").appendChild(display);
showOutput = "";
} else if (!isNaN(parseInt(storeInput)) && storeInput > 9) {
var display = document.createElement("p");
display.innerText = "Value entered is too big! Please Enter 1 - 9 only";
document.getElementById("output").appendChild(display);
} else if (storeInput === "clear") {
console.log("hello this is working!");
document.querySelector("#output").textContent = "";
} else {
document.querySelector("#output").textContent =
"Please enter only numbers!";
}
};

//Part 1 completed//