title: how to get the individual id of an item in nodejs
body: <p>i have a delete api, it takes in the id of the item we want to delete, each item has its unique id, how do i get the id of the item the wants to delete and pass it to my api</p>
  
  <p>here is the api</p>
  
  <pre><code>    app.post("/delete_product", function (req, res) {
              var data = {
                  id: req.session.user_id,
                  token: req.session.token,
                  product_id: 4
      // you need to pass in the id of the product in data.product_id
              };
             functions.callAPIPost(
                  "https:/theurl/delete_product",
                  data,
                  function (error, result) {
                      var response = result;
                      if (response.status === 400) {
                          console.log('ggg',response)
                          res.render('products', {
                              result: result.data
                          })
                      } else {
                          res.redirect('logout')
                      }
                  }
  
              );
          });
  
  </code></pre>
  
  <p>this is my ejs</p>
  
  <pre><code>&lt;form method='post'  action='/delete_product'&gt;
         &lt;button&gt;&lt;iclass="os-icon os-icon-trash" style='font-size: 16px; display: inline-block; vertical-align: middle; margin-right: 10px; color: #8095A0;'&gt;&lt;/i&gt;&lt;span&gt;Delete&lt;/span&gt;&lt;/button&gt;
  &lt;/form&gt;
  
  </code></pre>
  
  <p>i have an array of objects, which display as items in the browser after i loop thru them, they all have their individual id, how do i get the id once a user clicks on the item delete button that call the api to delete it.</p>
  
  <pre><code> [
          {
              "id": 3,
              "name": "work dress",
              "description": "take to work dress",
              "price": "2000",
              "created_at": "2020-02-26T20:30:08.000Z"
          },
          {
              "id": 4,
              "name": "movie dress",
              "description": "take to movie dress",
              "price": "2000",
              "created_at": "2020-02-26T20:30:08.000Z"
          },
          {
              "id": 5,
              "name": "home dress",
              "description": "stay at home dress",
              "price": "2000",
              "created_at": "2020-02-26T20:30:08.000Z"
          }
      ]
  
  </code></pre>