日期:2014-05-17  浏览次数:20617 次

innetHTML的一些问题
1.IE自动消除空白符
var div = document.createElement("div");
div.innerHTML = "   <p>    <b>   hello  </b>js    </p>   ";
console.log("|" + div.innerHTML + "|")

   IE8: |<P><B>hello </B>js </P>|
Chrome: |   <p>    <b>   hello  </b>js    </p>   |

2.在IE中以下元素的innerHTML是只读的:
col、 colgroup、frameset、html、 head、style、table、tbody、 tfoot、 thead、title 与 tr