First, preface
I believe you are familiar with the character to achieve multiple consecutive spaces input bar! This article intends to three kinds of HTML entities and JS related operations for further collation and summary, if there are flaws please correct me, thank you.
Second, the first knowledge of HTML entities
Because some characters in HTML are reserved (such as >, <, and so on), to display the reserved characters correctly after parsing the HTML, you need to use a character entity instead.
Character entities are represented in two ways:
// entity name &entity_name; // entity number & #entity_number;
Entity name benefits are easy to remember, but not all browsers can recognize all entity names.
All the entity numbers are recognized by all browsers.
Note: The entity name is case sensitive Oh!
Three, 3 types of entities
Entities are divided into ASCII entities, character entities, and symbol entities. Please refer to the HTML iso-8859-1 Reference manual for details.
For the use of each entity please refer to @ Zhang Xin Asahi's "Web page related to some of the common characters of the introduction", here to borrow a bit about the space character portion of the content.
, which is the space key. The width is affected by the font and is destroyed in the Inline-block layout, but is necessary in the justify layout.
  , 1/2 medium character width, and the width is not affected by the font.
  , 1 Chinese characters are width, and the width is not affected by the font.
  , I do not know what is the use of space.
Iv. manipulating entities through outerhtml,innerhtml,innertext,textcontent and value
First we need to divide 3 entity types into two classes, one for ASCII entities and one for character and symbol entities.
for ASCII entities
1. outerHTML and innerHTML of non-form elements can only get entity name or entity number;
2. Ie/chrome the innertext of non-form elements can obtain the corresponding characters;
3. Ie9+/ff/chrome the textcontent of non-form elements can obtain the corresponding characters;
4. The textarea value can be used to obtain the corresponding character.
For character entities and symbol entities
Only the corresponding characters can be obtained and the entity name and entity number cannot be obtained directly.
V. Summary
Please correct me if there is any mistake, thank you.
Respect the original, reprint please indicate from: http://www.cnblogs.com/fsjohnhuang/p/4319483.html ^_^ Fat Boy John
JS Magic Hall: Re-recognize ASCII entities, symbol entities, and character entities