<%- include("header") -%>

  <div class="box" id="heading">
    <h1> <%= listTitle %> </h1>
  </div>

  <div class="box">


  <%  newListItems.forEach(function(item){ %>

    <form action="/delete" method="post">
      <div class="item">
        <input type="checkbox" name="checkbox" value="<%=item._id%>" onChange="this.form.submit()">
        <p><%=item.name%></p>
      </div>
      <input type="hidden" name="listName" value="<%= listTitle %>"></input>
    </form>
  <%  }) %>


      <form class="item" action="/" method="post">
        <input type="text" name="newItem" placeholder="New Item" autocomplete="off">
        <button type="submit" name="list" value="<%= listTitle %>">+</button>
      </form>
  </div>

<%- include("footer") -%>
