title: trouble with setAttribute
body: <pre><code>function Todo(id, task, who, dueDate) {
      this.id = id;
      this.task = task;
      this.who = who;
      this.dueDate = dueDate;
      this.done = false;
  }
  
  
  function updateDone(e) { 
        var spanClicked = e.target;
        var id = spanClicked.parentElement.id;
        spanClicked.innerHTML = "&amp;nbsp;&amp;#10004;&amp;nbsp;";
        spanClicked.setAttribute("class", "done");
        console.log("you clicked this span" + id);
  
  
        for(var i = 0; i &lt; todos.length; i++) {
          if (todos[i].id == id) {
              var mark = todos[i];
              mark.setAttribute("class", "done");
              console.log(mark);
              break;
              }
             } 
      }
  </code></pre>
  
  <p>The first part of this function updates the webpage to show that an object is "done". The second part is where I'm having problems. I'm trying to update the object as "done" inside of an array. The idea was to match the id of what the user clicks on to the id in the array and then set it as "done" by using setAttribute. However the console message that I get for console.log(mark) is mark.setAttribute is not a function. Any suggestions on how I can modify this so that I can update the object in the array as "done"?</p>