function openWindow(){
var mychar=confirm("是否打開新窗口");
if(mychar==true)
{
var win=confirm("默認為 http://www.xianlaiwan.cn/");
if(win==true)
{
window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
var mychar=confirm("是否打開新窗口");
if(mychar==true)
{
var win=confirm("默認為 http://www.xianlaiwan.cn/");
if(win==true)
{
window.open('http://www.xianlaiwan.cn/','_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
function hidetext()
{
var mychar = document.getElementById("con").style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
{
var mychar = document.getElementById("con").style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
2015-07-18
function openWindow() {
if (confirm('是否打開新窗口')) { window.open("http://www.baidu.com","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
if (confirm('是否打開新窗口')) { window.open("http://www.baidu.com","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
prompt(str,str2)。str1是消息框中文本。str2是輸入框中文本,如果初始輸入框為空也不要省略str2,應寫上分號"",若省略則輸入框中顯示default。
例如score=prompt("請輸入你的分數","")
例如score=prompt("請輸入你的分數","")
2015-07-17
function openWindow(){
var n=confirm("是否打開?");
if(n==true){
var a=prompt("請輸入網址","http://www.baidu.com");
}if(a=="http://www.baidu.com"){
window.open("http://www.baidu.com","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
var n=confirm("是否打開?");
if(n==true){
var a=prompt("請輸入網址","http://www.baidu.com");
}if(a=="http://www.baidu.com"){
window.open("http://www.baidu.com","_blank","width=400,height=500,menubar=no,toolbar=no");
}
}
消息對話框:prompt(str1,str2);str1,要顯示在消息對話框中的文本,不可修改 ;str2:文本框中的輸入內容,可以重新輸入
返回值:點擊確定按鈕,文本框中的內容將作為函數返回值,取消按鈕將返回null
返回值:點擊確定按鈕,文本框中的內容將作為函數返回值,取消按鈕將返回null
2015-07-17
mychar.style.color="red";
mychar.style.backgroundColor="Gray"
mychar.style.width="300";
mychar.style.backgroundColor="Gray"
mychar.style.width="300";
2015-07-17
確認對話框:confirm(str);str,在消息框中要顯示的文本,返回bool。點擊確定返回true,點擊取消返回false
2015-07-17
document.write(""或者變量名),document.write(***+***);用加號連接??梢詫懭雋tml標簽,起作用。
2015-07-17
<input type="button" value="點擊" onclick="add2()">
添加點擊事件。然后
寫函數調用。
添加點擊事件。然后
寫函數調用。
2015-07-17