Get the App
SLTechnology News&Howtos  ›  Network Security  › 

HTML escape character

Shulou Source: shulou.com Published: 2022-06-01 08:45:17 10月03日 Update

In HTML, a string containing special characters (such as &) is to be displayed on the page, because it will be regarded as the tag structure of HTML when added to the text node, resulting in some errors, so these special characters should be escaped.

For example, in

Tag, add a string "alert ('hello')", and escape the string.

The escape string (Escape Sequence), that is, the character Character Entity, is divided into three parts: the first part is a & symbol, the English part is called ampersand;, the second part is the Entity name or # plus the Entity number; the third part is a semicolon.

For example, to display a less than sign (greater than > >)

& & symbol &

"double quotes"

'single quotation marks & apos

Copyright ©©

Registered trademark ®®

Trademark (USA) ™

× multiplication sign × ×

/ division sign / /

Tags: Character entity escape string special white space trademark quotation mark label symbol part square ingenious multiplication semicolon dynamic name common common Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MySQL NVidia Shulou Information vpn