<script type="text/javascript">
function myFunction(){
document.getElementById("demo").innerHTML="新内容"
}
</script>
</head>
<body>
<h1>我的Web页面</h1>
<h2> <p id="demo">原来内容</p></h2>
<button type="button" onclick="myFunction()">变身</button>
</body>
原内容
点击变身后的内容