I am facing a challenge in my code where I want to pass a link text in a hyperlink to another page. My web app is build based on Express.
This is the hyperlink (in a dropdown list) in one page:
<a class="dropdown-item" href="/history" ><%=dateArray[index-1]%></a>
I want to grab the link text dateArray[index-1], and send it to /history page.
This is relative code in my app.js:
app.route("/history")
.get(function(req, res) {
getDate();
List.find({}, function(err, lists) {
res.render("history", {
day: day,
lists: lists
});
});
})
Please ignore the irrelevant code here.
What should I do here in app.js to grab the dateArray[index-1] value and send it to /history route?
Million thanks in advance.