title: Variable expression into javascript without using th:inline
body: <p>I searched first but I found confusing answers since I'm new to Thymeleaf and amateurish at best at javascript.</p>
  
  <p>I just want to know how to pass variable expressions into javascript functions, sort of like in JSP:</p>
  
  <pre><code>&lt;a href="#" onclick="javascript:getContactId('${contact.id}');"&gt;Button&lt;/a&gt;
  </code></pre>
  
  <p>Of course, this fails with Thymeleaf and passes the string ${contact.id} instead of its value, so how could I get the value of the variable expression instead?</p>
  
  <p>The reason I want it this way is because it depends on the row which is being iterated by <code>th:each</code>.</p>
  
  <p>If there's no other way except to use <code>th:inline</code>, then what's the best approach considering the above statement?</p>