Thymeleaf placeholder in input type=“text”

前端 未结 1 1226
傲寒
傲寒 2021-02-08 16:34

I have this input text in a


I want to replace the text

相关标签:
1条回答
  • 2021-02-08 17:20

    There is a specific Thymeleaf attribute for that:

    <input type="text" id="usernameId"  name="username" th:placeholder="#{user.placeholder}" />
    

    It can also be written like this:

    <input type="text" id="usernameId"  name="username" th:attr="placeholder=#{user.placeholder}" />
    
    0 讨论(0)
提交回复
热议问题