Get the App
SLTechnology News&Howtos  ›  Development  › 

How JavaScript escapes html tags

Shulou Source: shulou.com Published: 2022-06-01 02:56:40 11月23日 Update

This article will explain in detail how JavaScript escapes html tags. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Escape html tag function HtmlEncode (text) {

Return text

.replace (/ & / g, "&")

.replace (/\ "/ g,'"')

.replace (/ / g, ">")

} this is the end of the article on "how JavaScript escapes html tags". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Tags escapes articles more good practical content articles knowledge references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MySQL Microsoft Shulou Tech Info Redmi