Copy codeThe Code is as follows: <script>
Document. getElementById ("trone"). innerHTML = "<td> haha </td> ";
</Script>
<Tr id = "trone">
</Tr>
In IE, "unknown runtime error" may sometimes occur, but not in firefox.
This is mainly because when IE writes innerHTML, it will check whether the element meets the requirements of the html object container in the content, for example, if you add html code containing <li> In A p file, this will cause an error. So if you find these errors occur, try to do two things:
1. Check whether the html code you tried to add to innerHTML contains broken html tags. For example, <li> </li> is not surrounded by <ul> </ul>.
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> labels in the correct format are added to the <td> labels. Therefore, avoid using these labels as containers, if necessary, you can use <td> as a container and then nest a table.
Therefore
<Td id = "trone"> </td> use document. getElementById ("trone"). innerHTML = "new.
You can use javascript to dynamically create <tr> <td> and other labels instead of using innerHTML.