Q: Difference between th:text and th:value in Thymeleaf I just recently started using Thymeleaf through one of my projects. I have seen few examples where th:text=${example} is being used in some places th:value=${example}.
I have gone through the Thymeleaf documentation but couldn't find anything explicitly citing the difference, nor did any question on SO.
Any help would be really appreciated! Thanks.

A: *

*th:value is modification of html attribute value. 
For button, input and option elements, the value attribute specifies the initial value of the element

*th:text is used for tag body modification. 




div{background-color: lightblue; padding: 2px} // to highlight empty div
<!--th code:               <div th:value="${value}"/></div> -->
<br/>Result th:value div:  <div value="sometext"/></div>
        
<!--th code:               <form><input th:value="${value}"/></form>-->
<br/>Result th:value form: <form><input value="sometext"></form> 

<!--th code:               <div th:text="${value}"></div> 
Same as:                   <div>[[${value}]]</div> -->
<br/>Result th:text div:   <div>sometext</div>


Here is docs of different Thymeleaf attributes features 

A: Lets see an example:
<input type="radio" name="gender" value="male"> Male<br>

if we want to use thymeleaf in value portion of this input tag, then we will use,
<input type="radio" name="gender" th:value="${someValue}"> Male<br>

if we want to see the text (here Male) sent from the controller dynamically, then we use,
<input type="radio" name="gender" th:text="${someText}""> <br>


A: th:name => This would be the name of the value that you will be passing to another page (Exemplar scenario).
th:value => This would be the actual value that you would be passing. It could be obtained from a model or straight from the database explicitly.
<form th:action="@{confirm-pass-details.html}">
    <button type="submit" th:name="event-id" th:value="${event.get().getEventid()}">Buy Passes</button>
</form>


