简体   繁体   中英

font Awesome As Value Of Submit button

I would like display a font awesome icon as the submit input value. I tried the following code as per this SO question Font-awesome, input type 'submit'

Demo http://jsfiddle.net/sw87W/1077/

$(document).ready(function() {
  $('.btn-primary').val('');
});

I do not have any control over the html that is generated, therefore I can not change the input to a button

您可以只使用Unicode转义序列

$('.btn-primary').val('\uf0c7');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM