到后面你们就会理解这一节的重要性了 后面用getElementById()来获取节点的时候就要放在你要获取的节点的后面不然会找不到233333
2016-07-31
最赞回答 / 小菜鸟飞
window.open(b,'width=400','height=500','menubar','toolbar');;这句话应该是 window.open(b,‘_blank','width=400,height=500,menubar=yes,toolbar=yes’);吧 最后else那一句也这么改,加上'_blank’, 后边的参数都在一个单引号里
2016-07-30
也可以写成
<script language="javascript">
document.write("开启JS之旅v");
</script>
<script language="javascript">
document.write("开启JS之旅v");
</script>
2016-07-30
function openWindow(){
openWindow =prompt("是否打开","http://www.imooc.com") ;
if(openWindow=="http://www.imooc.com")
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
}
else
{
document.write("好的!");
}
}
openWindow =prompt("是否打开","http://www.imooc.com") ;
if(openWindow=="http://www.imooc.com")
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
}
else
{
document.write("好的!");
}
}
function openWindow(){
var mymessage=confirm("是否打开") ;
if(mymessage==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no, status=no,scrollbars=yes')
}
else
{
document.write("好的!");
}
}
var mymessage=confirm("是否打开") ;
if(mymessage==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no, status=no,scrollbars=yes')
}
else
{
document.write("好的!");
}
}
//定义"隐藏内容"的函数
function disp(){
document.getElementById("txt").style.display="none";
}
//定义"显示内容"的函数
function disp2(){
document.getElementById("txt").style.display="block";
}
//定义"取消设置"的函数
function restart(){
if(confirm("是否取消设置")){
document.getElementById("txt").style=""
}
}
function disp(){
document.getElementById("txt").style.display="none";
}
//定义"显示内容"的函数
function disp2(){
document.getElementById("txt").style.display="block";
}
//定义"取消设置"的函数
function restart(){
if(confirm("是否取消设置")){
document.getElementById("txt").style=""
}
}