title: Including JavaScript variable inside thymeleaf
body: <p>How do I include a JavaScript variable inside thymeleaf for checking a condition?</p>
  
  <h2>Tried:</h2>
  
  <pre><code>&lt;div th:if="${myVariable == 5}"&gt;
   //some code
  &lt;/div&gt;
  </code></pre>
  
  <p>but it's not working.</p>