I have an ejs file where a table is displayed with the user id and name that is fetched from a mysql database. There are also buttons in all the rows of the table.
I have an external .js file with a variable called 'currentID' which I want to get from the button click in the table of the ejs file.
So for example, when i click on the button with the id = 1 and name = abc. I want to run a function from the ejs file which will save 1 into the 'currentID' variable in my js file.
Set .js file variable value from ejs on button click