Skip to content
Advertisement

Is there any way to get value in node js server while clicking on div

Here is my EJS file

JavaScript

Html view here

My routes are in the below route:-

JavaScript

SO here I want, whenever I click on any of the div I want to print the mac id in log from the respective div in plugDashboard section. So is there any way to do so? I searched for many solutions none of them were helpful for me.

Advertisement

Answer

You can add new GET express route, for example:

JavaScript

and after that just add ajax call on click event:

JavaScript
Advertisement