JS是如何修改P标签内容的innerHTML和innerText

innerHTML

1
2
3
var obj = document.getElementById("p");
alert(obj.innerHTML);
obj.innerHTML= "Zhan5u";

innerText

1
2
3
var obj = document.getElementById("p2");
alert(obj.innerText);
obj.innerText= "站无忧";