读取html内容而不转义?
我正在尝试使用InnerHTML读取HTML内容。它似乎转换了'<'在'& lt的文本内容中;' 。
我宁愿不这样做。 JS中有什么可以让我这样渲染
I am trying to read the html content using innerHTML. It seems to convert the '<' in the text content to '<' .
I would rather not to. Is there anything in JS that would allow me to render as such
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Lodash 支持执行此操作的 unescape() 函数。
例如,
此问题中提供了更多答案:在 JavaScript 中取消转义 HTML 实体?
Lodash supports an unescape() function that does this.
For example,
More answers are available in this question: Unescape HTML entities in JavaScript?