This is my code, I want to get childNodes and loop create these tag, But print 2 in IE8
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="div"></div>
<script type="text/javascript">
var div = document.getElementById('div');
var code = '<script>alert("hello");<\/script><div>dsd<\/div><script>alert("hi");<\/script>';
div.innerHTML = code;
console.log(div.children.length);
console.log(div.childNodes.length)
</script>
</body>
</html>