This project is written in HTML, CSS and Javascript that help me to finish the tasks.
First check if the input is empty or not, if empty,the window out alert, if not empty, the window will add a task
function addTask(){
if(inputBox.value === ""){
alert("Please Enter a Task");
}
else{
let li = document.createElement("li");
li.innerText = inputBox.value;
listContainer.appendChild(li);
let span = document.createElement("span");
span.innerText = "\u00D7";
li.appendChild(span);
}
inputBox.value = "";
saveData();
}
function saveData(){
localStorage.setItem("data", listContainer.innerHTML);
}
function showData(){
listContainer.innerHTML = localStorage.getItem("data");
}
you can view live demo from here