我想在<input type="reset">
中添加一个Font Awesome图标。
如果我使用超链接或按钮可以实现这一点,但如果我选择这种方法,我需要使用jQuery/JS来清除表单,而我目前正在尝试避免这样做。
我想知道是否有可能实现相同的结果。请查看JSFiddle以了解我的意思。
Input Reset:
<input type="reset" class="btn btn-warning" value=""><i class="fa fa-times"></i> Clear</input>
<br/>
<br/>
Button:
<button class="btn btn-warning"><i class="fa fa-times"></i> Clear</button>
<br/>
<br/>
Anchor:
<a href="#" class="btn btn-warning"><i class="fa fa-times"></i> Clear</a>
如果没有其他方法,我将实施一个jQuery解决方案。
font-family
更改为font: normal normal normal 14px/1 FontAwesome;
,就像原始代码中一样。 - MortenMoulder