I am new to Spring boot and thymeleaf. I wanted to know how I could get the name or id of an image onclick. Any help or documentation would be appreciated.
I am new to Spring boot and thymeleaf. I wanted to know how I could get the name or id of an image onclick. Any help or documentation would be appreciated.
Maybe you should try this one:
th:attr="onclick=|what you want to do|"
or you can use use the tag inside th:each:
<img th:src="@{'/photos/' + ${yourimage.image}}"/>
depending on what you want to do.
And as long as you asked for documentation, check this out about attributes: https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#setting-value-to-specific-attributes