XHTML provides a special set of characters
1. These characters sometimes appear in the document, but cannot be spelled in their own style.
2. In some cases, these characters have special meanings in XHTML, such as>, <, and &.
3. In other cases, some characters do not have corresponding buttons on the keyboard, such as small circles that indicate Celsius temperature.
4. In addition, there are some non-wrap spaces. The browser recognizes them as hard spaces. The browser cannot exclude some spaces like processing other spaces.
These special characters are called entities, which are the names of them by the browser. The entity in the document can be replaced by the corresponding characters in the browser.
Some common character entities are listed below:
Character entity meaning
& Amp; and Mark
<& Lt; Yu no.
> & Gt; greater
"& Quot; double quotation marks
'& Apos; or & #39; single quotes
1/4 & frac14; 1/4
1/2 & frac12; 1/2
3/4 & frac34; 3/4
. & Deg; degree Celsius
(Space) & nbsp; non-wrap Space
For example, if you call a JS function in the onmouseover attribute, double/single quotation marks (") and layer-3 nesting may occur. The browser may find a syntax error, therefore, the "or" in the function parameters must be replaced by the actual body (it seems that there are other methods, so this is the simplest ).
In IE, & apos; cannot replace '. It can only be replaced with & #39;. "It is no problem to replace & quot;. In Firefox, & apos; and & #39; can be correctly interpreted as single quotation marks '.