我在我的WordPress网站上有一个搜索栏,并使用jQuery替换了“搜索”单词,想要使用Font Awesome的图标。但是它只显示Font Awesome代码,而不是图标。
我该如何用Font Awesome图标替换提交按钮文本?
由于这在侧边栏中,我似乎无法编辑“值”。这是我目前所拥有的...
<form role="search" method="get" id="searchform" class="searchform" action="http://localhost/">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" value="" name="s" id="s">
<input type="submit" id="searchsubmit" value="Search"></input>
</div>
</form>
<script type="text/javascript">
var $elem = $("#searchsubmit");
$elem.html("<i class='fa fa-eye'></i>");
</script>
input
元素没有HTML内容。这只适用于button
。 - iCollect.it Ltd