When I did JavaScript online typing exercises, I found that JavaScript's Character Processing on different browsers is different.
Space Processing
When "a [any space] a" is entered in the DIV, HTML is displayed in the same way as Chrome and IE: Only one space is displayed.
InnerHTML attributes
- IE still adds a space to two a's,
- Chrome is the original input.
Enter
When "a [Press enter] [any space] a" is entered in the DIV, Chrome and IE are displayed in HTML.
InnerHTML attributes
- IE is a three-character with a space in the middle of two.
- Chrome is the original input, and the carriage return is parsed as \ n.
HTML Tag
When "a" is entered in the DIV
A "HTML is the same in Chrome and IE.
InnerHTML attributes
- IE is
A. the HTML Tag is capitalized!
- Chrome is
A. Mark HTML in lower case
Enter in TEXTAREA
In the textarea multi-line input box, enter a [Press enter] B. HTML displays Chrome and IE.
Value Attribute
- IE is a 4-character string with the following content: a \ r \ nb
- Chrome is a 3-character string with the following content: a \ nb
Reprinted from http://www.cnblogs.com/zjfree/