JavaScript 中可通过document.getElementById("Id名"),然后 .innerHTML=“改变后的内容”
<html>
<body>
<h1>第一段JacaScript</h1>
<p id = "demo">
JavaScript 能改变HTML内容
</p>
<script>
function myFunction()
{
x = document.getElementById("demo");
x.innerHTML = "想我吗";
}
</script>
<button type = "button" onclick = "myFunction()">点击这里
</button>
</body>
</html>