How to pass HTML from a variable to a div
?
I have code
<div class="content" th:text="${ourService.getShortText()}" />
But it shows not HTML in the div
, but escaped HTML as div
text.
How to pass the variable's value not as an escaped text, but as inner HTML of the div
?
The solution is as follows:
<div class="content" th:utext="${ourService.getShortText()}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With