From 777fae723dd5e9f30bbb223615446a056428ad44 Mon Sep 17 00:00:00 2001 From: Adrian Hodrea Date: Mon, 9 Mar 2020 17:25:08 +0200 Subject: [PATCH 1/2] clean code fixed --- index.html | 16 +++------------- index.js | 8 ++++---- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index c932db0..2d4c7c4 100644 --- a/index.html +++ b/index.html @@ -1,24 +1,14 @@ - eh - - - - - - - + + + - \ No newline at end of file diff --git a/index.js b/index.js index aa02b17..458fc75 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,8 @@ 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]) + const newItem = document.createElement("li"); + const textNode = document.createTextNode("Water"); + newItem.appendChild(textNode); + document.querySelector('ul').insertBefore(newItem, document.querySelector('ul').childNodes[0]) console.log("works!!!"); }); From b6ef4011bbf8984af6086225f1b261fd68a7613f Mon Sep 17 00:00:00 2001 From: Adrian Hodrea Date: Mon, 9 Mar 2020 17:27:35 +0200 Subject: [PATCH 2/2] orice --- index.html | 4 ++-- index.js | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 2d4c7c4..8faa922 100644 --- a/index.html +++ b/index.html @@ -4,11 +4,11 @@ - eh + Water - + \ No newline at end of file diff --git a/index.js b/index.js index 458fc75..eb12d50 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ document.querySelector('button').addEventListener('click', function () { - let event = this.window; - const newItem = document.createElement("li"); - const textNode = document.createTextNode("Water"); + const newItem = document.createElement('li'); + const textNode = document.createTextNode('Water'); newItem.appendChild(textNode); document.querySelector('ul').insertBefore(newItem, document.querySelector('ul').childNodes[0]) - console.log("works!!!"); });