//定义"取消设置"的函数
function Reset(){
var a=confirm("是否要取消设置?");
if (a==true)
{
a=document.getElementById("txt");
// a.style="#txt";
a.removeAttribute("style");
}
}
function Reset(){
var a=confirm("是否要取消设置?");
if (a==true)
{
a=document.getElementById("txt");
// a.style="#txt";
a.removeAttribute("style");
}
}
最赞回答 / 幸福的小草
if(score=null){//这里判断条件错了,应该是scroe==null; document.write("OK"); }score=null;是给score赋了一个null的值,无论输入是什么,代码执行到上面的语句后,都把score的值重新赋值为null了,所以 都会执行 document.write(score+"要努力了!")
2016-04-17
已采纳回答 / studdy
1、var url=prompt("确认打开的网址"," http://www.imooc.com" 逗号2、 if(open==ture) true
2016-04-16
function openwindow()
{
var a=confirm("打开窗口吗");
var b="http://www.imooc.com";
if (a==true) {
var c=prompt("请输入网址",b);
window.open(c,'_blank','width=400','height=500');
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openwindow()" />
</body>
</html>
{
var a=confirm("打开窗口吗");
var b="http://www.imooc.com";
if (a==true) {
var c=prompt("请输入网址",b);
window.open(c,'_blank','width=400','height=500');
}
}
</script>
</head>
<body>
<input type="button" value="新窗口打开网站" onclick="openwindow()" />
</body>
</html>
已采纳回答 / PC桃花依旧
如果我不输入任何内容就点击确认,myname="" alert("你好"+myname); 结果就只有“你好”点击取消时才是 null 即else部分
2016-04-16