jQuery adding to JSP page

后端 未结 3 843
生来不讨喜
生来不讨喜 2021-01-02 12:48

I have a piece of jQuery code which I found on the internet and I want to integrate it to my jsp page, I use Spring form tags.

Here is the jQuery code:



        
3条回答
  •  执笔经年
    2021-01-02 13:23

    jQuery, like any JavaScript, is added in a

    Having done that, you want now to leverage your jQuery in the HTML tags, you do that as for any HTML page. Namely, in your case, you don't have to take away the spring tags. Let it generate the select/options via your ${listOfInstitutionsNames}, just add class="testclass" to your spring form tag, like this :

    
    

    When rendering the form on a browser, Spring will include in the generated HTML the class attribute with value of testclass.

    Hope that helps, best of luck.

提交回复
热议问题