意思是有两个结果一个是null一个是[object HTMLParagraphElement]
null的意思是为空,当你的id名与DOM里标签p的id名不相同时,结果是null,
object是对象,Paragraph是段落,也就是html里p标签的全称,整段话的意思就是在html里p标签为对象
null的意思是为空,当你的id名与DOM里标签p的id名不相同时,结果是null,
object是对象,Paragraph是段落,也就是html里p标签的全称,整段话的意思就是在html里p标签为对象
2016-08-13
var mywin=prompt("是否打开");
if(mywin=true)
{
window.open('http://www.imooc.com/','_blank','wide=400,high=500');
}else{
}
if(mywin=true)
{
window.open('http://www.imooc.com/','_blank','wide=400,high=500');
}else{
}
最新回答 / 沉默的范大叔3379743
哪里有问题?不知楼主的问题指什么问题?是代码逻辑写错了,还是运行结果不是期望的看楼主的代码逻辑,应该是没有问题的,如果是运行结果不对,不知道楼主的结果是什么,我只能猜测你使用.one的话,你并没有配置color,backgroundColor以及display, 所以div元素内的颜色还是没有变回来,这是我的猜测你没有设置onClick按钮,函数没有执行
2016-08-13
mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
2016-08-13
我书读的少,只能这样了,"取消设置"的函数
function rset()
{
if(confirm("取消设置?")){
mytxt.style.display="block";
mytxt.style.width="600px";
mytxt.style.height="400px";
mytxt.style.color="black";
mytxt.style.backgroundColor="white";
}
}
function rset()
{
if(confirm("取消设置?")){
mytxt.style.display="block";
mytxt.style.width="600px";
mytxt.style.height="400px";
mytxt.style.color="black";
mytxt.style.backgroundColor="white";
}
}
function m1(){
var a=document.getElementById("con");
a.style.color="red";
a.style.backgroundColor="yellow"
}
//定义"改变宽高"的函数
function m2(){
var a=document.getElementById("txt");
a.style.width="300px";
a.style.height="500px";
}
var a=document.getElementById("con");
a.style.color="red";
a.style.backgroundColor="yellow"
}
//定义"改变宽高"的函数
function m2(){
var a=document.getElementById("txt");
a.style.width="300px";
a.style.height="500px";
}
最新回答 / H0st
这个方法是通过元素ID来获取元素属性的,这里有一些说明,以及使用方法。http://www.w3school.com.cn/jsref/met_doc_getelementbyid.asp
2016-08-12