If you want the text
<button id="b">0</button><div id='votes'>⇐</div>
to appear on the page, as it seems, write it as
<button id="b">0</button><div id='votes'>&Leftarrow;</div>
That is, the code in the question but the ampersand &
before Leftarrow
escaped as &
, by normal HTML rules.
However, the character reference ⇐
is an addition in HTML5 and not supported by older browsers. It is a pointless risk to use it, instead of the HTML 4 entity reference ⇐
, which is considerably more widely supported. Or you could enter the character “⇐” itself, provided that developers know how to use UTF-8 property, as they should.
The entity &Arrowleft
mentioned in the question does not belong to any HTML version. The names of entity/character references for arrows are very confusing (who would have guessed that ←
and ←
are the same thing, but different from⇐
?), which is yet another reason to use the character themselves, or numeric references like ⇐
.
Note that independently of these notational issues, the character “⇐” is has limited font support. If you only use it in an icon-like manner, using an image, with an adequate alt
text, is probably a safer option.