最赞回答 / chrisyuan
window.open("ans",'_blank','width=400px,height=500px,menubar=no,toolbar=no');中的ans应该去掉双引号
2016-03-14
已采纳回答 / 四十九
if 判断的时候 应该是“==” 而不是“=”, “==”是判断;你用的是“=”,“=”是用来赋值的 你把它给直接赋值成真的了 所以造成判断的时候 条件为真 一直打开新网页
2016-03-14
已采纳回答 / 芳的独家记忆
<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>className属性</title><style> body{ font-size:16px;} .one{ border:1px solid #eee; width:230px; height:50p...
2016-03-14
function openWindow(){
var mywin = confirm("是否打开");
if (mywin){
var mywin2 = prompt("是否打开网址","http://www.imooc.com");
window.open(mywin2,'_blank','width=400px','height=500px','menubar=no','toolbar=no');
}
else }; };
var mywin = confirm("是否打开");
if (mywin){
var mywin2 = prompt("是否打开网址","http://www.imooc.com");
window.open(mywin2,'_blank','width=400px','height=500px','menubar=no','toolbar=no');
}
else }; };
最赞回答 / qq_大头儿子_0
需要在changclass()方法里面加一句 var mychar=document.getElementById("con");因为不同方法里面的变量是不相关的,需要重新命名。
2016-03-14
<script type="text/javascript">
function add2()
{
alert("哈哈,调用函数了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="点击我" onclick=" add2() " />
</form>
</body>
</html>
function add2()
{
alert("哈哈,调用函数了!");
}
</script>
</head>
<body>
<form>
<input type="button" value="点击我" onclick=" add2() " />
</form>
</body>
</html>
2016-03-14