Thymeleaf onclick href with variable

Use <a> tag instead of onClick.
Your code will look something like this –

    <a th:href="@{/owners/{id}/edit(id=${owner.id})}"> 
         <button type="button"> some button text </button> 
    </a>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top