From 1eef8933a39932761e1aec3fa068543e8072e496 Mon Sep 17 00:00:00 2001 From: nicoleta-tuturuga Date: Sun, 15 Mar 2020 21:17:26 +0200 Subject: [PATCH] refactor ns-6 --- index.html | 17 ++++++----------- index.js | 11 +++++------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index c932db0..530f5e7 100644 --- a/index.html +++ b/index.html @@ -5,20 +5,15 @@ - eh - - + Bob's water - + + + + - - - + \ No newline at end of file diff --git a/index.js b/index.js index aa02b17..5d25911 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,7 @@ document.querySelector('button').addEventListener('click', function () { - let event = this.window; - var NewItem = document.createElement("LI"); - var textnode = document.createTextNode("wateR"); - NewItem.appendChild(textnode); - document.querySelector('ul').insertBefore(NewItem, document.querySelector('ul').childNodes[0]) - console.log("works!!!"); + let newItem = document.createElement("li"); + let textnode = document.createTextNode("Here is you're water, Bob."); + newItem.appendChild(textnode); + document.querySelector('ul').insertBefore(newItem, document.querySelector('ul').childNodes[0]) + console.log("Bob received his water!!!"); });