Home > Web Front-end > JS Tutorial > javascript innerHTML usage analysis_javascript skills

javascript innerHTML usage analysis_javascript skills

WBOY
Release: 2016-05-16 18:14:49
Original
1045 people have browsed it

Space processing

When entering "a[any number of spaces]a" in DIV, the HTML rendering is the same under Chrome and IE: only one space is displayed.

innerHTML attribute

  • IE is still two a’s plus a space.
  • Chrome looks like the original input.

Enter

When entering "a[Enter][any number of spaces]a" in DIV, the HTML rendering in Chrome and IE is the same.

innerHTML attribute

  • IE is 3 characters, with a space between the two a’s.
  • Chrome looks like the original input, parsing the carriage return as n.

HTML tag

When entering "a
a" in DIV, the HTML rendering is the same under Chrome and IE.

innerHTML attribute

  • In IE, it is a
    a, which capitalizes the HTML tag!
  • Chrome is a
    a, lowercase HTML tags

Enter in TEXTAREA

Enter a[Enter]b in the textarea multi-line input box, and the HTML rendering in Chrome and IE will be the same.

value attribute

  • IE is 4 characters, the content is: arnb
  • Chrome is 3 characters, the content is: anb
Reprinted from http://www.cnblogs.com/zjfree/
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template