HTML
“
Add
“`
JS
function addTask(){
if(inputBox.value === ''){
document.getElementById("errmsg").innerHTML = "You Must Write Somthing!";
return false;
}
else{
let li = document.createElement("li");
li.innerHTML = inputBox.value;
listContainer.appendChild(li);
let span = document.createElement("span");
span.innerHTML = "×";
li.appendChild(span);
}
inputBox.value = '';
saveData();
}
I want to give an error in the placeholder, but it’s overwriting (https://i.sstatic.net/oT2UfccA.png) I’m new in JS, so I didn’t get how to fix it plz help me 🙁