帮我生成一个基于HTML和js的动态网页
<!DOCTYPE html>
<html>
<head>
<title>动态网页</title>
<script type="text/javascript">
function changeText() {
var text = document.getElementById("text");
text.innerHTML = "Hello, World!";
}
<pre><code> function changeColor() {
var text = document.getElementById("text");
text.style.color = "red";
}
</script>
</code></pre>
</head>
<body>
<h1 id="text">这是一个动态网页</h1>
<button onclick="changeText()">改变文本</button>
<button onclick="changeColor()">改变文本颜色</button>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/EM0 著作权归作者所有。请勿转载和采集!