function openWindow(){
var panduan=confirm("是否打开");
if(panduan==true){
window.open('http://www.imooc.com' ,'_blank','width=600,height=400,top=100,menubar =no,toolbar=no')
}
else{}
}
var panduan=confirm("是否打开");
if(panduan==true){
window.open('http://www.imooc.com' ,'_blank','width=600,height=400,top=100,menubar =no,toolbar=no')
}
else{}
}
已采纳回答 / smilefriend
这是啥意思?document.getElementsByName("name_value"),不就是这样写吗?或者用jquery,$("[name=name_value]")这样也能获取到该对象。
2016-07-19
@于果果:这个问题,如果当面给你一指,你就很容易看到。但形成文字的话,确实有点费劲。。。看着有这么多同学给你点了赞,可能还是有不少同学没看到行号。
我试着解释一下吧:这个页面明显分为左、中、右三块,能看到吧?
左边是:为什么学习JavaScript(浅灰色背景);
右边是:代码执行结果(白色背景);
那么重点来了,中间是:【代码】。
中间这部分是黑色底纹(背景)的。
中间这部分又分为两块:右边是代码,左边(约一厘米宽度),就是一系列阿拉伯数字
1
2
3
……
12
13
明白了吧,呵呵。
我试着解释一下吧:这个页面明显分为左、中、右三块,能看到吧?
左边是:为什么学习JavaScript(浅灰色背景);
右边是:代码执行结果(白色背景);
那么重点来了,中间是:【代码】。
中间这部分是黑色底纹(背景)的。
中间这部分又分为两块:右边是代码,左边(约一厘米宽度),就是一系列阿拉伯数字
1
2
3
……
12
13
明白了吧,呵呵。
2016-07-19
dom元素节点,属性节点,文本节点
document.getELementById获取元素
Object.style.property=新的属性
Object.style.display=none/block显示或隐藏
Object.className=新的className
document.getELementById获取元素
Object.style.property=新的属性
Object.style.display=none/block显示或隐藏
Object.className=新的className
2016-07-19
function openWindow(){
var s = prompt("打开某网站","http://www.imooc.com/");
if(s=="http://www.imooc.com/"){
window.open("http://www.imooc.com/","_blank","width=400,height=500,menubar=no,toolbar=no");
}
else{alert("fail");}
}
var s = prompt("打开某网站","http://www.imooc.com/");
if(s=="http://www.imooc.com/"){
window.open("http://www.imooc.com/","_blank","width=400,height=500,menubar=no,toolbar=no");
}
else{alert("fail");}
}
function f5(){
var obj = document.getElementById("txt");
var myfive=confirm("change");
if(myfive){
obj.removeAttribute("style");
}
}
//定义"取消设置"的函数
var obj = document.getElementById("txt");
var myfive=confirm("change");
if(myfive){
obj.removeAttribute("style");
}
}
//定义"取消设置"的函数
function f3(){
mythree=document.getElementById("txt");
mythree.style.display="none";
}//定义"隐藏内容"的函数
function f4(){
myfour=document.getElementById("txt");
myfour.style.display="block";
}//定义"显示内容"的函数
mythree=document.getElementById("txt");
mythree.style.display="none";
}//定义"隐藏内容"的函数
function f4(){
myfour=document.getElementById("txt");
myfour.style.display="block";
}//定义"显示内容"的函数
function f1(){
myone=document.getElementById("txt");
myone.style.color="red";
//定义"改变颜色"的函
}
function f2(){
mytwo=document.getElementById("txt");
mytwo.style.height="500px";
}//定义"改变宽高"的函数
myone=document.getElementById("txt");
myone.style.color="red";
//定义"改变颜色"的函
}
function f2(){
mytwo=document.getElementById("txt");
mytwo.style.height="500px";
}//定义"改变宽高"的函数
var mychar= document.getElementById("con").innerHTML;
document.write("结果:"+mychar); //输出获取的P标签。
document.write("结果:"+mychar); //输出获取的P标签。
2016-07-19