i have populate some values using c:forEach tag. I want to get those values in my javascript.
If I click GetCtag value button, then i want to
It is only possible for JavaScript to access the data in the HTML as it is SEEN BY THE BROWSER.
The method I would recommend is to generate JSON (however your Web-API allows that) and store it in JavaScript code -- perhaps a global. Of course, keeping this data "closer" to where it is used is advisable, but the same holds. Another approach is to use custom HTML attributes (hopefully starting with "data-" for HTML5-compliance).