function openWindow(){
var tip=confirm("是否打开新网址?");
if(tip==true){var wangzhi=prompt("请编辑您要打开的网址","http://www.imooc.com");
if(wangzhi!=null){window.open(wangzhi,"_blank",'width=400,height=400')
}
else{alert("您未确认打开新网址"); }
}
else{alert("您未确认打开新网址");
}
}
var tip=confirm("是否打开新网址?");
if(tip==true){var wangzhi=prompt("请编辑您要打开的网址","http://www.imooc.com");
if(wangzhi!=null){window.open(wangzhi,"_blank",'width=400,height=400')
}
else{alert("您未确认打开新网址"); }
}
else{alert("您未确认打开新网址");
}
}
<script type="text/javascript">
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
function add(){
var p1 = document.getElementById("p1");
p1.className="one";
}
function modify(){
var p2 = document.getElementById("p2");
p2.className="two";
}
2020-06-04
var mychar= document.getElementById("con");
mychar.style.color="white";
mychar.style.backgroundColor ="black";
mychar.style.width="1000px";
mychar.style.color="white";
mychar.style.backgroundColor ="black";
mychar.style.width="1000px";
2020-06-04
function openWindow(){
var mymessage=confirm("是否打开新窗口?");// 新窗口打开时弹出确认框,是否打开
if(mymessage==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,top=100,left=0,menubar=no,toolbar=no');
}
else
{
alert("滚犊子!");
}
}
var mymessage=confirm("是否打开新窗口?");// 新窗口打开时弹出确认框,是否打开
if(mymessage==true)
{
window.open('http://www.imooc.com','_blank','width=400,height=500,top=100,left=0,menubar=no,toolbar=no');
}
else
{
alert("滚犊子!");
}
}
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000,heigt=1000,top=100,left=0,menubar=no,toolbar=no, status=no,scrollbars=yes',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="亲爱的请进来!" / >
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000,heigt=1000,top=100,left=0,menubar=no,toolbar=no, status=no,scrollbars=yes',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="亲爱的请进来!" / >
2020-06-04
<script type="text/javascript">
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000','heigt=1000','top=100','left=0',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="亲爱的请进来!" / >
function Wopen(){
window.open('http://fjhtyznkj.cn.gongxuku.com/','_blank','width=1000','heigt=1000','top=100','left=0',);
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="亲爱的请进来!" / >
2020-06-04
function rec(){
var mymessage=confirm("你是女士?"); ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
var mymessage=confirm("你是女士?"); ;
if(mymessage==true)
{
document.write("你是女士!");
}
else
{
document.write("你是男士!");
}
}
2020-06-04
<script type="text/javascript">
function rec(){
var mychar="I love JavaScript";
alert(mychar);
}
function rec(){
var mychar="I love JavaScript";
alert(mychar);
}
2020-06-04
<script type="text/javascript">
function contxt() //定义函数
{
alert("哈哈,调用函数了!");
}
contxt();
</script>
</head>
<body>
<form>
<input type="button" value="点击我" onclick="contxt()" />
function contxt() //定义函数
{
alert("哈哈,调用函数了!");
}
contxt();
</script>
</head>
<body>
<form>
<input type="button" value="点击我" onclick="contxt()" />
2020-06-04
function openWindow(){var isOpen = confirm('是否打开?');
if (isOpen) {var isImooc = prompt('请输入网址','http://www.imooc.com/');
if(isImooc == 'http://www.imooc.com/') {window.open('http://www.imooc.com','_blank','width=400,height=500, menubar=no, toolbar=no'); }
}
}
if (isOpen) {var isImooc = prompt('请输入网址','http://www.imooc.com/');
if(isImooc == 'http://www.imooc.com/') {window.open('http://www.imooc.com','_blank','width=400,height=500, menubar=no, toolbar=no'); }
}
}