Thymeleaf template engine, how to write the th tag when dynamically stitching html in js?

something like this:

picStr = "<div>" +
         "  <a href="/front/images/img_1.jpg" th:href="@{/front/images/img_1.jpg}"></a>" +
         "</div>"";

but it seems that th doesn"t work here, he just writes there:

clipboard.png

I have tried to write this way, and the result is still:

picStr = "<div th:inline="text">" +
         "  <a href="/front/images/img_1.jpg" [[/front/images/img_1.jpg]]></a>" +
         "</div>";
Sep.09,2021

try it out or not

picStr = "<div th:inline="text">" + "<a href="/front/images/img_1.jpg" th:href="@{/front/images/img_1.jpg}"></a>" + "</div>";
Menu