Created a list which is 3 elements long but how to remove elements.created an event to remove but not working
<link href="https://fonts.googleapis.com/css?family=Lobster&display=swap" rel="stylesheet">
<html>
<head>
<script src="https://kit.fontawesome.com/b7917e45f4.js"></script>
</head>
<body>
<div id="cont">
<div id="main">
<div id="form">
<label>
<input id="input" type="text" name="text" placeholder="Write a todo" required>
</label>
<div class="but_cont">
<button type="submit">Add to list</button>
</div>
<div id="list_block">
<nav class="nav1">
<ul class="ul1">
</ul>
</nav>
<nav class="nav2">
<ul>
<li><i class="clear fas fa-trash-alt"></i></li>
<li><i class="clear fas fa-trash-alt"></i></li>
<li><i class="clear fas fa-trash-alt"></i></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</body>
</html>
console.clear()//clear console to avoid continuing console prints.
const BUTTON = document.querySelector('button')//button
const INPUTFIELD = document.querySelector('input[type="text"]')//inputfield
const UL = document.querySelector('.ul1')//ul element
let array = []//array for creating
function addItem(){
//e.preventDefault();
let item = document.createElement('li')//creating list item
let value = INPUTFIELD.value//getting input value
let dynamic = document.createTextNode(value)//creating dynamic value
item.append(dynamic)//appending it to the dynamic list item
if(event.keyCode === 13){//check if the key typed is 'Enter key' i.e 13
if(array.length > 2)return//check if the length does not exceed more than three list items
UL.append(item)//if the above conditions are passed then append them to the UL element which is the unordered list
array.push(UL)
//if(array.length > 3)return
}
//array.push(item)
//console.log(array)
//UL.insertAdjacentHTML(item)
}
INPUTFIELD = window.addEventListener("keydown",addItem)
//------remove items----//
const deleteLogo = document.querySelectorAll('.clear')
//console.log(deleteLogo)
function removeItems(){
let trash = []
trash.push(deleteLogo)
//console.log(trash)
if(UL === `${INPUTFIELD.value}`){
console.log("remove")
}
for(let i = 0;i<trash.length;i++){
UL[i].innerHTML = ""
}
}
deleteLogo = window.addEventListener('click',removeItems)