We can also pass the value from a JSP page to the java script as we have done in our previous example of passing values to the java script from the HTML page. Since in JSP page we can embed HTML tags as well.
In our this example of passing values from jsp page to java script we have created a function hello() which takes value from the jsp page on click of some button and then shows it through the alert().
Here is the example code of the JSP page which is passing value to the java script as follows:
Liked it! Share this Tutorial