亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

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

document.write("hello");

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

?document.write ("hello")什么意思,?

? document.getElementById 什么意思呀 ?不懂 這怎么記?求解!


正在回答

5 回答

document.write("hello");//輸出hello//

?document.getElementById("p1").style.color="blue";//將id為p1的元素的文本顏色設置為藍色//

document.getElementById();是DOM中元素獲取方法中的一種,通過元素的id名來獲取元素

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

慕慕0677951 提問者

非常感謝!
2017-04-13 回復 有任何疑惑可以回復我~

document.write("");

是指輸出雙引號內的字符串

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

選取背景為p1的樣式是指規定顏色為藍色

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

document.write("hello"); //輸出hello

document.getElementById("p1") ,是指獲取document對象

document.getElementById("p1").style.color="blue"; ,是指將所獲取的document對象的樣式顏色改為藍色

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

?document.write ("hello")是指在網頁上打印出"hello"這個詞;

?document.getElementById("p1").style.color="blue" 是指操作id為"p1"的樣式,這里把id為"p1"的顏色樣式修改成了藍色

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

JavaScript中輸出hello

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

舉報

0/150
提交
取消

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

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號