<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>innerHTML</title>
</head>
<body>
<h1 id="con">javascript<h1>
<p>xxx</p>
<script type="text/javascript">
var mychar=document.getElementById("con");
document.write("原来:"+mychar.innerHTML+"<br>");
mychar.innerHTML="HELLO WORLD"
document.write("现在:"mychar.innerHTML);
</script>
</body>
guozhchun
相关分类