Unicode in data-content for pseudo element content
问题 I would like to put unicode in the data-content attribute using JQuery so as to use it for pseudo element content, but I can't find the right format. How do you display unicode? The fallowing just displays ▼ . a::after { content: attr(data-content); } <a href="...">...</a> $("a").attr ("data-content", "▼"); 回答1: Insert in this format, using the \u that, in Javascript, denotes an Unicode number inside a string literal $("a").attr ("data-content", "\u25BC"); From MDN Unicode escape docs: You