document.getElementById(“id”)
注:獲取的元素是一個對象,如想對元素進行操作,我們要通過它的屬性或方法。
1.document.getElementById("con")
2.直接輸出獲取的對象,結果為null或[object HTMLParagraphElement]
注:獲取的元素是一個對象,如想對元素進行操作,我們要通過它的屬性或方法。
1.document.getElementById("con")
2.直接輸出獲取的對象,結果為null或[object HTMLParagraphElement]
2015-06-17
在輸入代碼mywin.close();的時候會不斷的打開網頁,建議把調試的時候加入到提交那里,并且驗證題目是否正常
2015-06-17
//定義"改變顏色"的函數
function changeColor(){
div.style.color = "blue";
}
//定義"改變寬高"的函數
function changeWH(){
div.style.width = "600px";
div.style.height = "500px";
}
//定義"隱藏內容"的函數
function changeHide(){
div.style.display = "none";
}
function changeColor(){
div.style.color = "blue";
}
//定義"改變寬高"的函數
function changeWH(){
div.style.width = "600px";
div.style.height = "500px";
}
//定義"隱藏內容"的函數
function changeHide(){
div.style.display = "none";
}
這課程很好啊,先直接從dom講起,而不是javascript,感覺很實用
document.write(element)和alert(element)返回對象信息
object HTMLParagraphElement
document.write(element)和alert(element)返回對象信息
object HTMLParagraphElement
2015-06-16