第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

新手求解???

<!doctype html>

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">

<title>初識css</title>

<script type="text/javascript">

document.write("hello");

document.getElementById("p1").style.color="blue";

</script>

</head>

<body>

<p id="p1">我是第一段文字</p>

<p id="p2">我是第二段文字</p>

</body>

</html>

為什么P1不顯示為藍色?

正在回答

1 回答

<!doctype?html>
<html>
<head>
????<meta?http-equiv="content-type"?content="text/html;?charset=utf-8">
????<title>初識css</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>

因為你的js代碼執(zhí)行時,頁面的p標簽還沒有生成。

0 回復 有任何疑惑可以回復我~
#1

qq_嘴角洋溢起的一絲微笑_0 提問者

非常感謝!
2015-11-26 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學習       741070    人
  • 解答問題       9797    個

JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門

進入課程

新手求解???

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號