How to place a checkMark as a character?

Viewed 22199
$("#status").html('<img src="available.png">Available');  

Instead of checkMark picture I want a chekMark character.
Is there a way, please?

6 Answers

You can also use a check mark in a web font.

This question (and the answers) are now five years old. For the sake of those coming from Google, I wanted to add another option that's become available in recent years, but is not mentioned in previous answers.

You can certainly still use unicode characters (.html("&#10003;") or .text("\u2713"), but in the past few years web fonts have become more common. For example, material icons has a check mark: https://material.io/icons/#ic_check

Google (who made and maintains material icons) also did a good job of explaining web fonts and how to use them here: https://google.github.io/material-design-icons/

Basically web fonts are the best of both worlds: the customization of images and the usage/dynamics of font characters. The advantages to using web fonts over unicode characters are:

  • control over style (you can make your own web font character of any style, whereas unicode characters are what they are)
  • use of multiple styles (you can make web fonts with numerous styles of check marks for different situations; you're not locked into one style)
  • code readability (very few developers will know what \u2713 or &#10003 means, but <i class="myfont">check</i> is easy to understand
  • portability: although every major browser uses a unicode font by default, there are still some computers or devices which may render with a non-unicode font by default. In fact, wikipedia's current list of unicode fonts is decently long, but the supported characters vary widely between each font, and there are clear differences between how the each font is rendered by different platforms. Including a webfont ensures that every user will see the same thing, regardless of platform or default fonts.
  • More options: having an installed webfont allows you to update the style, add new icons/characters to the font, etc. There is no way to currently do this with unicode.
Related