Javascript innerHTML Usage Analysis

Source: Internet
Author: User

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 <Br> a" HTML is entered in the DIV, it is displayed in the same way in Chrome and IE.

InnerHTML attributes

  • IE is a <BR> a. The HTML Tag is capitalized!
  • Chrome is a <br> 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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.