JavaScript innerhtml usage Analysis _javascript Tips

Source: Internet
Author: User

Space handling

When you enter "a[any space]a" in a Div, HTML renders the same as chrome and IE: only one space is displayed.

innerHTML Property

  • IE or two a plus a space,
  • Chrome is the original input.

Enter

When you enter "a[carriage return [any space]a" in a Div, HTML renders the same as chrome and IE.

innerHTML Property

  • IE is 3 characters, with a space in the middle of two A.
  • Chrome is the original input and resolves the carriage return to \ n.

HTML markup

When you enter "A<br>a" html in the Div, the same is the case with chrome and IE.

innerHTML Property

  • IE is a<br>a, the HTML tag is capitalized!
  • Chrome is a<br>a, HTML tag lowercase

TextArea, carriage return

Entering a[carriage return]b,html in the textarea multiline input box is the same as for Chrome and IE.

Value property

  • IE is 4 characters, the content is: A\R\NB
  • Chrome is 3 characters, content is: A\NB
Reprinted from http://www.cnblogs.com/zjfree/
Related Article

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.