title: how to call a JavaScript method inside th:if from Thymeleaf?
body: <p>The title says it all. I have an HTML element like this: </p>
  
  <pre><code>&lt;label th:if="${#fields.hasErrors('weight') &amp;&amp; 'isModalFirstOpening();'}" th:errors="*{weight}"&gt;&lt;/label&gt;
  </code></pre>
  
  <p>You can see here that I want to show this label field only when there is an  error in the variable <code>weight</code> and that javascript function <code>isModalFirstOpening()</code> returns true. However, this code does not work.</p>
  
  <p>Can you help me? Thank you for reading.</p>