I am quite new in node.js and trying to learn the language.
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.
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.
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.
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);
});
}