Found to be under IE6-IE9, the innerHTML property of the following element table,thead,tfoot,tbody,tr,col,colgroup,html,title,style,frameset is read-only

Source: Internet
Author: User

Table id= "zhutitable" html2= "<tr></tr>", Data settableinnerhtml (document.getElementById (' zhutitable '), HTML2); function setTableInnerHTML(table, html) { //table 为table对象,html为生成的html字符串    if (navigator && navigator.userAgent.match(/msie/i)) {      var temp = table.ownerDocument.createElement( ‘div‘ );      temp.innerHTML = ‘<table>‘ + html + ‘</table>‘ ; //注意此处传进来的html变量包含“<tbody></tbody>”标签  如果HTML变量中没有 则为 ‘<table><tbody>‘ + html + ‘</tbody></table>‘      table.replaceChild(temp.firstChild.firstChild, table.tBodies[0]); //用生成的div中table的tbody替换原table中的tbodyTable.appendchild (Temp.firstChild.firstChild); Used to add TR to the generated table    } else {      table.innerHTML = html;    } }Get the tbody assignment in a table

var otbodydata = document.getElementById (' zhutitable '). Tbodies.item (0);
OTBODYDATA.INNERHTML+=HTML2;

Found to be under IE6-IE9, the innerHTML property of the following element table,thead,tfoot,tbody,tr,col,colgroup,html,title,style,frameset is read-only

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.