為啥沒變色?
按照提示填的,提示是正確的,但是沒有看到變藍色,代碼如下:
<!DOCTYPE HTML>
<html>?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>熱身</title>
</head>
<body>
? <p id="p1">我是第一段文字</p>
? <p id="p2">我是第二段文字</p>
??
? <script type="text/javascript">
document.write("hello");
document.getElementByID("p1").style.color="blue";
? </script>
</body>
</html>
2018-08-20
JavaScript嚴格分辨大小寫,如果弄錯大小寫。程序會報錯。
2018-08-20
document.getElementByID("p1").style.color="blue";錯了。
document.getElementById("p1").style.color="blue";
2018-08-20
已經知道了getElementByID應該是getElementById才是對的