感觉是这样
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" http-equiv="content-type" content="text/html"/>
<title></title>
<script type="text/javascript">
function newwin(){
var newpid =confirm("是否打开");
if(newpid ==true){
var proid = prompt("请输入网址","https://www.imooc.com");
if(proid!=null){
window.open("https://www.imooc.com");
}else{
}
}
else{
}
}
</script>
</head>
<body>
<form>
<input type="button" value="点击" name="id1" onclick="newwin()" />
</form>
</body>
</html>