let todoarray = JSON.parse(localStorage.getItem("todos")) || []; function additem() { let text = document.getElementById("todoitem").value; // jestli text je prázdný tak ukončí celou funkci if (text.trim() == "" ) {return;} todoarray.push(text); console.log(todoarray); savetodos(); renderlist(); document.getElementById("todoitem").value = ""; } function createlist(value, index){ i = index+1 document.getElementById("todolist") .innerHTML += '