SOURCE

console 命令行工具 X clear

                    
>
console
window.onload = function()
{
    var oDiv = document.createElement("div");
    var oP=document.createElement("P");
    var oText=document.createTextNode("Hi");
    oP.appendChild(oText);
    oDiv.appendChild(oP);
    
    var oP1=document.createElement("P1");
    var oText1=document.createTextNode("MrSu");
    oP1.appendChild(oText1);
    oDiv.appendChild(oP1);

    document.body.appendChild(oDiv);
    
    var oDiv1 = document.createElement("div");
    oDiv1.innerHTML="<p>Hi,Jack</p><p> innerHTML</p>";
    document.body.appendChild(oDiv1);

    console.log("There is a:"+ oDiv.innerText);
    console.log("There is a:"+oDiv1.innerText);

    document.body.innerHTML="<div><p>Hi,Xiaoming</p><p>hello,Lihua</p></div>";
    document.body.innerHTML="<div>存在即<span>合理</span><strong></strong></div>";
    document.write("hi,document.write");

}    
<!DOCTYPE html> 
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">   
    </style>
    <script>
       
    </script>
</head>
<body>
</body>
</html>