我的警报完全正常,其他代码已删除,但在实施其他所有内容后停止工作。除警报功能外,一切都有效。有人可以帮助我吗?
HTML文件
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Red Text, Verdana Font, Alert</title>
</head>
<body>
<p id = "my1"></p>
<p id = "my2"></p>
<p id = "my3"></p>
<script src ="kappa.js"></script>
</body>
</html>
Javascript文件
alert("Coding with JavaScript");
var my1 = document.getElementById("my1");
my1.innerHTML = "Red Text";
var my2 = document.getElementById("my2");
my2.innerHTML = "Vardana Font";
var my3 = document.getElementById("my3");
my3.innerHTML = "Alert";
document.getElementById("my1").style.color = "#ff0000";
document.getElementById("my2").style.color = "#ff0000";
document.getElementById("my3").style.color = "#ff0000";
document.getElementById("my1").style.fontFamily = "verdana";
document.getElementById("my2").style.fontFamily = "verdana";
document.getElementById("my3").style.fontFamily = "verdana";