<!DOCTYPE html>
<html>
<body>
<p id="header">Old Header</p>
<script>
var element=document.getElementById("header");//换成getElementsByTagName("p")就不行
element.innerHTML="New Header";
document.write(element.innerHTML);
</script>
<p>"Old Header" 已被修改为 "New Header"。</p>//换成TagName后原来的没被修改
</body>
</html>
Caballarii
雅趣
echo1111
echo_kinchao
O_Yancey
相关分类