title: Thymeleaf - Iterating over a model attribute inside Javascript code
body: <p>I'm trying to write some Javascript code where I need to use a model attribute. Here is how I define the script tag:</p>
  
  <pre><code>&lt;script type="text/javascript" th:inline="javascript"&gt;
      /*&lt;![CDATA[*/
  
      //need some loops
  
      /*]]&gt;*/
  &lt;/script&gt;
  </code></pre>
  
  <p>What I need to do is, using <code>each</code> iterations over model attributes inside the script. So far I couldn't manage to do this with <code>th:each</code>. Any help is appreciated.</p>