var mychar=document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>");
mychar.innerHTML="Hello world"
document.write("修改后的標題:"+mychar.innerHTML);
document.write("原標題:"+mychar.innerHTML+"<br>");
mychar.innerHTML="Hello world"
document.write("修改后的標題:"+mychar.innerHTML);
2016-01-07
<script type="text/javascript">
function Wopen(){
window.open('http://www.baidu.com','_blank','width=600,height=400,top=100,left=100') ;
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >
</body>
</html>
function Wopen(){
window.open('http://www.baidu.com','_blank','width=600,height=400,top=100,left=100') ;
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >
</body>
</html>
2016-01-06
var message = confirm("是否打開");
if(message==false)
{
return ;
}
var webadd = prompt("你要打開的網站為","http://www.xianlaiwan.cn/");
if(webadd == "http://www.xianlaiwan.cn/")
{
window.open('http://www.xianlaiwan.cn/','_blank','width=400px','height=500px','menubar=no','toolbar=on');
}
}
if(message==false)
{
return ;
}
var webadd = prompt("你要打開的網站為","http://www.xianlaiwan.cn/");
if(webadd == "http://www.xianlaiwan.cn/")
{
window.open('http://www.xianlaiwan.cn/','_blank','width=400px','height=500px','menubar=no','toolbar=on');
}
}
confirm 消息對話框通常用于允許用戶做選擇的動作,如:“你對嗎?”等。彈出對話框(包括一個確定按鈕和一個取消按鈕)。
語法:
confirm(str);
參數說明:
str:在消息對話框中要顯示的文本
返回值: Boolean值
返回值:
當用戶點擊"確定"按鈕時,返回true
當用戶點擊"取消"按鈕時,返回false
語法:
confirm(str);
參數說明:
str:在消息對話框中要顯示的文本
返回值: Boolean值
返回值:
當用戶點擊"確定"按鈕時,返回true
當用戶點擊"取消"按鈕時,返回false
2016-01-06
<script type="text/javascript">
function openWindow(){
var mymessage=confirm(".imooc.com/");
if(mymessage == true){
window.open('http://www.xianlaiwan.cn','_blank','width=300,height=200,menubar=no,toolbar=no,status=no');
}else
{
}
}
</script> 為啥運行不正常
function openWindow(){
var mymessage=confirm(".imooc.com/");
if(mymessage == true){
window.open('http://www.xianlaiwan.cn','_blank','width=300,height=200,menubar=no,toolbar=no,status=no');
}else
{
}
}
</script> 為啥運行不正常
function openWindow(){
var queren=confirm("確認打開新的網頁嗎?");
if(queren==true){
var wangzhi;
wangzhi=prompt('請輸入網址','http://ocsm.cn'); window.open(wangzhi,'_blank','width=400,height=500,menubar=no,toolbar=no,status=no,scrollbar=no')
}
}
var queren=confirm("確認打開新的網頁嗎?");
if(queren==true){
var wangzhi;
wangzhi=prompt('請輸入網址','http://ocsm.cn'); window.open(wangzhi,'_blank','width=400,height=500,menubar=no,toolbar=no,status=no,scrollbar=no')
}
}