title: How to retrieve data from node.js (server side) using a variable from javascript (client side)?
body: <p>I am quite new in node.js and trying to learn the language.</p>
  
  <p>I am wondering if it is possible to get a variable from the html page and use that variable to find a row in the database and view that data in html. </p>
  
  <p>What I intend to do is I have a table where I can click on the info icon which will direct me to the details of that rows data.</p>
  
  <p>I have gotten the data that I want to refer to from the code below but I don't know how to pass that variable to the server side and proceed with it.</p>
  
  <p><a href="https://i.stack.imgur.com/5FKgK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5FKgK.png" alt="Table"></a></p>
  
  <pre><code>const icon = document.getElementsByClassName("iconButton");
  
  icon.addEventListener('click', myFunction(this));
  
  function myFunction(x){
      var $row;
      var $title;
      var $time;
      $(".iconButton").click(function() {
          $row = $(this).closest("tr");
          $title = $row.find(".topic").text();
          $time = $row.find(".time").text(); 
          alert($title);
          alert($time);
      });
  }
  </code></pre>