function openWindow(){
var mywin=confirm("请问是否要打开新的窗口?");
if(mywin==true)
{
var mp=prompt("输入将要打开的网址","http://www.imooc.com/");
if(mp!==null){
window.open(mp,'_blank','toolbar=no,menubar=no','width=400px,height=500px');
}
}
}
var mywin=confirm("请问是否要打开新的窗口?");
if(mywin==true)
{
var mp=prompt("输入将要打开的网址","http://www.imooc.com/");
if(mp!==null){
window.open(mp,'_blank','toolbar=no,menubar=no','width=400px,height=500px');
}
}
}
已采纳回答 / 木子舟义
function set() { if (confirm('是否恢复默认设置?')) { txt.removeAttribute("style"); }}这样写
2015-12-06
document.getElementById(“id”) 这条语句获取的是元素,包含开始标签到结束标签所有内容。想要输出元素内容需要在其后尾使用.innerHTML /*innerHTML看它的英文单词也可以明白就是里面的字符按html标记的语言格式取出来*/
2015-12-06
已采纳回答 / 木子舟义
//定义"改变宽高"的函数 function chwidth(){ mychar.style.width = "500px"; mychar.style.height = "500px";}你的函数花括号 打成了中文的{} 应该是{}
2015-12-06
<script type="text/javascript">
var mp=window.open('http://www.imooc.com');//将新打开的窗口对象,存储在变量mp中
mywin.close();
</script>
var mp=window.open('http://www.imooc.com');//将新打开的窗口对象,存储在变量mp中
mywin.close();
</script>
2015-12-06
function Wopen(){
var wopen()=window.open('http://www.imooc.com','_blank','width=300,height=200,mennubar=no,toolbar=no,status=no,scrollbars=yse');
wopen();
}
var wopen()=window.open('http://www.imooc.com','_blank','width=300,height=200,mennubar=no,toolbar=no,status=no,scrollbars=yse');
wopen();
}
2015-12-06
var myname=prompt("请输入你的姓名:");
if(myname!=null){
alert("你好,"+myname);
}else{
alert("你好,我的朋友");
}
</script>
</head>
<body>
<input name="button" type="button" onClick="myname()" value="点击我,对成绩做评价!" />
if(myname!=null){
alert("你好,"+myname);
}else{
alert("你好,我的朋友");
}
</script>
</head>
<body>
<input name="button" type="button" onClick="myname()" value="点击我,对成绩做评价!" />
2015-12-06
function r(){
var check=confirm("您是中国人吗?");
if(check==true)
{
document.write("我是中国人");
}else{
document.write("我不是中国人");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="r()" value="点击我,弹出确认对话框" /> 很简单
var check=confirm("您是中国人吗?");
if(check==true)
{
document.write("我是中国人");
}else{
document.write("我不是中国人");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="r()" value="点击我,弹出确认对话框" /> 很简单
2015-12-06