var elem=document.getElementById("txt");
//定义"取消设置"的函数
function modifySetting(){
var msg = confirm("取消以上的设置");
if(msg){
elem.removeAttribute('style');//取消设置恢复默认雅样式
}else{
alert("不做操作");
}
}
//定义"取消设置"的函数
function modifySetting(){
var msg = confirm("取消以上的设置");
if(msg){
elem.removeAttribute('style');//取消设置恢复默认雅样式
}else{
alert("不做操作");
}
}
var message = confirm("是否打开?")
if(message == true){
window.open('_blank','http://www.imooc.com/','width:400px,height:500px,menubar,toolbar');
}else{
document.write("否");
}
if(message == true){
window.open('_blank','http://www.imooc.com/','width:400px,height:500px,menubar,toolbar');
}else{
document.write("否");
}
<title>window.open</title>
<script type="text/javascript">
function Wopen(){
window.open("http:www.imooc.com","_blank","width=600,height=400,top=100,left=0")
}
</script>
<script type="text/javascript">
function Wopen(){
window.open("http:www.imooc.com","_blank","width=600,height=400,top=100,left=0")
}
</script>
2022-05-11
<title>close()</title>
<script type="text/javascript">
var mywin=window.open("http://www.imooc.com");
mywin.close();
</script>
<script type="text/javascript">
var mywin=window.open("http://www.imooc.com");
mywin.close();
</script>
2022-05-11