2

how to use thymeleaf replace text in html

i have tried

<a><i class="fa fa-home" th:text="${menuItem.name}" ></i>  <span class="fa fa-chevron-down"></span>

then get result

<a><i class="fa fa-home">Menu</i>  <span class="fa fa-chevron-down"></span></a>

i want get result like:

<a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down"></span>
BeerBubble
  • 43
  • 1
  • 6

1 Answers1

3
<a><i class="fa fa-home"></i> [[${menuItem.name}]] <span class="fa fa-chevron-down"></span>

or

<a><i class="fa fa-home"></i> <span th:text="${menuItem.name}" th:remove="tag"> Menu Item</span> <span class="fa fa-chevron-down"></span>
Venu Duggireddy
  • 786
  • 6
  • 9