Using Unicode in HTML Attributes

By Xah Lee. Date: . Last updated: .

Discovered that you can use Unicode in your HTML tag attribute values. Here's a sample HTML:

<html>
<head>
<title>Unicode in HTML Tag Attributes</title>
<style>
p.α {color:red}
</style>
</head>
<body>

<p class="α">yay!</p>

</body>
</html>

In the above, notice the greek alpha α character, used as attribute value.

This works in all latest versions of Firefox, Internet Explorer 8, Google Chrome, Safari, Opera, on Windows. (as of 2010-12)

You can use any other Unicode, including various bullets symbols, math symbols. For a sample list of Unicode chars, see: Sample Unicode Characters.

HTML: Allowed Characters in id Attribute

Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials