th:attr 任何属性值 <form action="subscribe.html" th:attr="action=@{/subscribe}"> <fieldset> <input type="text" name="email" /> <input type="submit" value="Subscribe me!" th:attr="value=#{subscribe.submit}"/> </fieldset> </form> 多个属性一起设置,用逗号隔开 <img src="../../images/gtvglogo.png" th:attr="src=@{/images/gtvglogo.png},title=#{logo},alt=#{logo}" /> 设置指定属性 复制代码 th:abbr th:accept th:accept-charset th:accesskey th:action th:align th:alt th:archive th:audio th:autocomplete th:axis th:background th:bgcolor th:border th:cellpadding th:cellspacing th:challenge th:charset th:cite th:class th:classid ... 复制代码 <input type="submit" value="Subscribe me!" th:value="#{subscribe.submit}"/> <form action="subscribe.html" th:action="@{/subscribe}"> <li><a href="product/list.html" th:href="@{/product/list}">Product List</a></li>