JS中Unicode编码使用 2020-03-04 JS 0 评论 字数统计: 174(字) 阅读时长: 1(分) JS中Unicode编码使用 在JS中使用Unicode编码. 格式: \u编码(十六进制) 编码一般都是十六进制的 在html中使用unicode编码. 格式: &#编码;(十进制) 后面一定要有分号. 12345678910111213141516171819202122232425<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript"> /* * 在字符串中使用转义字符输入Unicode编码 * \u四位编码 */ console.log("\u2620"); </script> </head> <body> <!--在网页中使用Unicode编码 &#编码; 这里的编码需要的是10进制 --> <h1 style="font-size: 200px;">☠</h1> <h1 style="font-size: 200px;">⚀</h1> </body></html>