title: Pass a variable from thymeleaf to a javascript function?
body: <p>I have an html file, thymeleaf, that has a variable passed from the controller that I need to give to a function on an external javascript file.
  How do I do this ?</p>
  
  <p>I can get the variable like     </p>
  
  <pre><code>&lt;label th:utext="${id}" &gt;&lt;/label&gt;
  </code></pre>
  
  <p>I need to pass that id to a function that's inside </p>
  
  <pre><code>&lt;script th:src="@{/js/myfunctions.js}" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>There's a function there :</p>
  
  <pre><code>function myFunction(id){
  
  }
  </code></pre>