Use innerhtml to add interface elements.
For example.
. Html
<Table id = "tab_1" width = "100%" border = "0"> </table>
. Js
Document. getelementbyid ("tab_1 "). innerhtml = "<tr> <TD colspan =" 5 "> <Div class =" double "> <span> some: </span> </div> </TD> </tr> ";
In IE, "unknown runtime error" may sometimes occur )",
But not in Firefox.
This is mainly because IE checks whether tab_1 meets the requirements of HTML object containers in the content when writing innerhtml. Therefore, if you find these errors, try to do two things:
1. Check the HTML you are trying to add to innerhtmlCodeContains damaged HTML tags. For example, <ul> </ul> <li> </LI> is not contained.
2. Change your container to the "inclusive" labels, such as <span> </span>, <div> </div>
Note that errors may occur when the <tbody>, <Table>, and <tr> label is correctly formatted. Therefore, avoid using these labels as containers.
If necessary, you can use <TD> as a container, and then use another layer of table.
------------------------------------
There are two reasons
1. The innerhtml attribute of the element is read-only ..
Read-Only elements: Col, colgroup, frameset, Head, HTML, style, table, tbody, tfoot, thead, title, tr
2. For example, if the innerhtml attribute of the DIV is modified when the DIV is nested in P, an error occurs.