Marchhill Marchhill - 1 year ago 159
HTML Question

Emoji buttons html

I am making a html website and I am trying to put unicode (utf-8) emojis on it. When I try to use unicode emojis on a button it works, but I need to use the jquery attr method to set the button value, and then it just comes up as unicode letters -- how can I fix this?

$("#example").attr("value", "😁");

(Example is a button)

<input type="button" name="example" id="example" value="example" class="btn btn-primary">

Answer Source

You need to render it as HTML, in which case use:


jsFiddle example

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download