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