<script th:inline="javascript"> // Enable Thymeleaf inlining var email = [[${user.email}]]; // Behaves just like in HTML </script>