Insert a variable into a template literal href tag
You have the wrong number of quotes in the <a>
element. You're creating something that looks like
<a href="venue/"cafeId">
The extra quote is causing everything after it to parse incorrectly.
Change that whole line to:
<h5 class="card-title venue-name" id="${cafeName}"><a href="venue/${cafeId}"></a></h5>
Add text from a variable to href link inside actor tag
Try this:
document.querySelectorAll('a').forEach(e => {
e.href += new Date().getTime();
})
<a href='https://www.w3schools.com/temp.pdf?date='>link</a>
<a href='https://www.w3schools.com/temp.pdf?date='>link</a>
<a href='https://www.w3schools.com/temp.pdf?date='>link</a>
Related Topics
Creating a Leaderboard in Html/Js
Why Does My Function Return Undefined Whilst I Do Give It an Argument
How to Read a Properties File in JavaScript from Project Directory
How to Trigger Change of Option in Dropdown When Options Can Have Same Value
How to Open a Url Link from JavaScript Inside a Google Apps Script HTML Google Site Gadget
How to Share and Edit Global Variables Between Two JavaScript Node Runs
It Is Possible to Call Class Function from Outside Class
Open Link in a Window Using Script (Google Sheet)
Determine If String Is in Base64 Using JavaScript
How to Access External Json File Objects in Vue.Js App
Passing Variable from One Js to Another Js File in Nodejs
How to Get Dynamic Id With Javascript/Jquery from PHP Loop
Scaling Between Two Number Ranges
Call Function Onpress React Native
Development Server of Create-React-App Does Not Auto Refresh