I searched first but I found confusing answers since I\'m new to Thymeleaf and amateurish at best at javascript.
I just want to know how to pass variable expressions
In Thymeleaf version 2.1, I have not been able to get the accepted answer to work. I did find some guidance from a Twitter post from Thymeleaf. Rather than using th:onclick, you use th:attr and specify the onclick attribute therein.
th:attr="onclick='javascript:getContactId(\'' + ${contact.id} + '\');'"