if(confirm("是否打开"))
{ var i=prompt("请输入","http://imooc.com/");
window.open("http://imooc.com/","_block","width=200","height=100");}
function con()
{
i.close();
}
</script>
</head>
<body>
<input type="button" value="关闭" onclick="con()"/>
{ var i=prompt("请输入","http://imooc.com/");
window.open("http://imooc.com/","_block","width=200","height=100");}
function con()
{
i.close();
}
</script>
</head>
<body>
<input type="button" value="关闭" onclick="con()"/>
<script type="text/javascript">
var mywin=window.open("http://www.imooc.com","_block","windth=200","height=150");
function closewindow()
{
mywin.close();
}
</script>
</head>
<body>
<input type="button" value="关闭" onclick="closewindow()"/>
</body>
</html>
var mywin=window.open("http://www.imooc.com","_block","windth=200","height=150");
function closewindow()
{
mywin.close();
}
</script>
</head>
<body>
<input type="button" value="关闭" onclick="closewindow()"/>
</body>
</html>
2018-11-25
最新回答 / Test_Engineer
onclick事件onclick 事件会在元素被点击时发生。例:<button onclick="myFunction()">Click me</button>当点击此按钮时执行javascript中的myFunction()函数
2018-11-24
已采纳回答 / Test_Engineer
因为步骤一:var mychar = document.getElementById("con");这个语句是把p标签的对象赋值给mycahr。而这个动作是通过点击“隐藏内容”和“显示内容”来执行的。你点击隐藏内容执行hidetext()函数,而函数体...
2018-11-23
最新回答 / 潇萌新吖
function sumb(){var set = confirm("确定重置吗?");if(set){text.removeAttribute("style")}}<...code...>
2018-11-22
最赞回答 / 我是一片水中的沸腾鱼
function resttext(){ var mychose= confirm("确认重置吗?"); if(mychose){ document.getElementById("txt").style.cssText="none"; }}
2018-11-21