Ryan O'Neill Ryan O'Neill - 3 months ago 8
HTML Question

Is it possible to show unicode characters in a HTML input type=submit value?

A customer has a designer mockup of a form button that shows a right facing triangle character after the main text, but I can't seem to get this showing. The offending markup is;



<input type="submit" value="Add to basket &#9654;" />





This should look like 'Add to basket ▶' (if it renders in your browser).

Is this possible or am I doing something wrong?

A jquery workaround is acceptable as a hack too. The page is HTML5 compliant, maybe that'll help.

Thanks in advance,

Ryan

Update: The answers below are correct, there was an easier way though, I just copied the triangle out of this question and straight into me HTML editor. No encoding needed.

Thanks all.

Answer

Ya you can use 100%

just ensure

Content-Type: text/html; charset=utf-8

should be present.

The meta tag is ignored by browsers if the HTTP header is present.

Also ensure that your file is actually encoded as UTF-8 before serving it, check/try the following:

Ensure your editor save it as UTF-8.

Ensure your FTP or any file transfer program does not mess with the file.

Comments