for(var i = 0; i < todos.length; i++) {
if (todos[i].id == id) {
var element = document.getElementById(todos[i].id);
element.setAttribute("class", "done");
console.log(element);
break;
}
}
or if "mark" in your example is not a DOM object, then you would just set it's done property to true.
for(var i = 0; i < todos.length; i++) {
if (todos[i].id == id) {
todos[i].done = true;
console.log(todos[i]);
break;
}
}