简体   繁体   English

如何将JQuery中元素的字符串更改为符号字符?

[英]How to change the string of an element in JQuery to a symbol character?

$("#third_param").text('ε') gives me the following $("#third_param").text('ε')给了我以下内容 “小量” , how do I fix this such that it shows the actual ε character ,如何解决这个问题,使其显示实际的ε字符

Use .html instead of .text : 使用.html而不是.text

$("#third_param").html('ε');

ε is an HTML entity, so you have to pass it through the HTML parser. 是HTML实体,因此您必须将其通过HTML解析器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM