Weird innerhtml problem on IE

Source: Internet
Author: User

Error message: htmlfile:Unknown runtime error
An unknown runtime error occurs when innerhtml is assigned a value.
This is where Ie is depressing and disgusting:

In ie, the interface is often changed through innerhtml.
However, the above errors often occur, but not in Firefox.

This is because when ie writes innerhtml, it checks whether the element meets the requirements of the HTML object container in the content,
For example, if <p> is used as the container and its innerhtml is placed in <li>, an error will occur immediately.

Even more depressing:
<Table> <tbody> <tr> cannot be used as an innerhtml container in IE.
None of them can be added to the correct <TD>
However, <TD> can be used as a container to put innerhtml including <Table>

Solution
1. Make sure that the HTML in innerhtmlCodeCorrect;
2. Ensure that the container containing innerhtml is correct:Generally, <div>, <span>, <TD>, and <p> are not used.

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.