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
You can do this like:
th:onclick="'javascript:getContactId(\'' + ${contact.id} + '\');'"