title: Remove item if checkbox is checked to-do list
body: <p>I'm building my own to-do list web application. I've setted up everything but there is one thing left. I want if one checkbox is checked, remove it from the array. How can I do this using DOM or anything? I've found some solutions on stackoverflow but couldn't realised how to use it with my own code. Please help me :)
  <a href="https://i.stack.imgur.com/R7xFN.jpg" rel="nofollow noreferrer">enter image description here</a>
  html:</p>
  <pre><code>&lt;%- include(&quot;header&quot;) -%&gt;
  
    &lt;div class=&quot;box hidden&quot; id=&quot;heading&quot;&gt;
      &lt;h1&gt; &lt;%= listTitle %&gt; &lt;/h1&gt;
    &lt;/div&gt;
  
    &lt;div class=&quot;box hidden&quot; id=&quot;todo&quot;&gt;
      &lt;% for (i = 0; i &lt; newListItem.length; i++) { %&gt;
      &lt;div class=&quot;item&quot;&gt;
        &lt;input type=&quot;checkbox&quot; id=&quot;remove&quot;&gt;
        &lt;p&gt; &lt;%= newListItem[i] %&gt; &lt;/p&gt;
      &lt;/div&gt;
      &lt;% }; %&gt;
      &lt;form class=&quot;item&quot; action=&quot;/&quot; method=&quot;post&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;newItem&quot; placeholder=&quot;New Item&quot; autocomplete=&quot;off&quot;&gt;
        &lt;button type=&quot;submit&quot; name=&quot;list&quot; value=&lt;%= listTitle %&gt;&gt;+&lt;/button&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  //animation
  $(document).ready(function () {
      $('#heading').fadeIn(1000).removeClass('hidden');
  });
  
  $(document).ready(function () {
      $('#todo').fadeIn(1000).removeClass('hidden');
  });
  
  &lt;/script&gt;
  
  &lt;%- include(&quot;footer&quot;) -%&gt;
  
  </code></pre>
  <p>app.js:</p>
  <pre><code>//jshint esversion:6
  
  const express = require('express');
  const bodyParser = require('body-parser');
  const date = require(__dirname + '/date.js')
  
  const app = express();
  let items = [&quot;Buy Chocolate&quot; , &quot;Heat Chocolate&quot; , &quot;Eat Chocolate&quot;];
  let schoolItems = [];
  
  
  app.set('view engine', 'ejs');
  
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(express.static(&quot;public&quot;));
  
  app.get(&quot;/&quot;, function(req, res) {
  
    let day = date.getDate();
    res.render(&quot;todolist&quot;, {
      listTitle: day,
      newListItem: items
    });
  });
  
  app.post(&quot;/&quot;, function (req, res) {
    let item = req.body.newItem;
    if (req.body.list === &quot;School&quot;) {
      schoolItems.push(item);
      res.redirect(&quot;/school&quot;);
    } else {
      items.push(item);
      res.redirect(&quot;/&quot;);
    }
  
  })
  
  app.get(&quot;/school&quot;, function (req, res) {
    res.render(&quot;todolist&quot;, {
      listTitle: &quot;School List&quot;,
      newListItem: schoolItems
    });
  });
  
  app.get(&quot;/about&quot;, function (req, res) {
    res.render(&quot;about&quot;);
  })
  
  
  app.listen(3000, function() {
    console.log(&quot;Server started on port 3000&quot;);
  })
  
  </code></pre>