I made the Todo list in JavaScript. I just use JavaScript. I want the work to be completed when the <li>
element is pressed on. I created a method for this. how do I do this process?
.completed {
text-decoration: line-through;
}
I want the post drawn when it is complete. I have prepared a CSS for it
let todos = [
{
id: 1,
title: "Javascript",
completed: true
},
];
function render() { /* I list object */
flen = todos.length;
text = "<ul id=myUL>";
for (i = 0; i < flen; i++) {
text +=
'<li id="' +
todos[i].id +
'">' +
todos[i].title +
"</li>";
}
text += "</ul>";
document.getElementById("demo").innerHTML = text;
}
render();
function completedTodo(e) { /*it's method */
}