html – 输入类型=“文本”中的Thymeleaf占位符

html – 输入类型=“文本”中的Thymeleaf占位符,第1张

概述我有一个输入文本 <input type="text" id="usernameId" name="username" placeholder="User" /> 我想从属性文件中替换1个文本的占位符用户的文本,但我不知道是否可能 <input type="text" id="usernameId" name="username" placeholder="th:text="#{user.pl 我有一个输入文本
<input type="text" ID="usernameID"  name="username" placeholder="User" />

我想从属性文件中替换1个文本的占位符用户的文本,但我不知道是否可能

<input type="text" ID="usernameID"  name="username" placeholder="th:text="#{user.placeholder}""  />
解决方法 有一个特定的Thymeleaf属性:
<input type="text" ID="usernameID"  name="username" th:placeholder="#{user.placeholder}" />

它也可以这样写:

<input type="text" ID="usernameID"  name="username" th:attr="placeholder=#{user.placeholder}" />
总结

以上是内存溢出为你收集整理的html – 输入类型=“文本”中的Thymeleaf占位符全部内容,希望文章能够帮你解决html – 输入类型=“文本”中的Thymeleaf占位符所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1141013.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-31
下一篇2022-05-31

发表评论

登录后才能评论

评论列表(0条)

    保存