請問:為啥調試結果顯示不是紅色的字
哪位大神能告訴我為什么我的調試結果不對,謝謝(代碼如下)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>bad domReady</title>
<script>
? setTimeout(function(){
?document.getElementById("header").style.color="red";
? },3000)
</script>
</head>
<body>
<h1 id="header">這里是h1元素包含的內容</h1>
</body>
</html>
2016-08-01
我調試了你的代碼,顯示是紅色的字。這個設置的時間是3s后變顏色,你刷新后等3s就看得到結果了。