在我运行下面的代码的那一刻 - 我按下按钮,它从 Davyd 变为 Aces ,从 Ace 变为 davyd。现在我如何使按钮从 Davyd 变为 Ace 到 Walter 到 Juan?
<html>
<script>
function myFunction() {
if (document.getElementById("davyd").innerHTML == "Acea") {
document.getElementById("davyd").innerHTML = "Davyd"
} else {
(document.getElementById("davyd").innerHTML == "Davyd")
document.getElementById("davyd").innerHTML = "Acea"
}`enter code here`
enter code here
};
</script>
<body>
<h1>A JavaScript-Enhanced Web Page</h1>
<p id="davyd">Acea</p>
<button type="button" onclick="myFunction()">Try it</button>
</body>
</html>
谢谢!全新的 Javascript