mychar.style.color="red";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
mychar.style.backgroundColor="#ccc";
mychar.style.width="300px";
2016-03-03
//通過兩個按鈕調用
<from>
<input type="button" value="open Window" onclick="opWin()"/>
<input type="button" value="close Winbdo" onclick="cloWin()/>
</from>
<from>
<input type="button" value="open Window" onclick="opWin()"/>
<input type="button" value="close Winbdo" onclick="cloWin()/>
</from>
2016-03-03
var mywin;
function opWin(){//打開窗口的方法
mywin=window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,top=100,left=0');
}
function cloWin(){//關閉窗口的方法
mywin.close();
}
function opWin(){//打開窗口的方法
mywin=window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,top=100,left=0');
}
function cloWin(){//關閉窗口的方法
mywin.close();
}
2016-03-03
document.write(<span style='white-space:pre'>"+string+"</span>");
string中的空格能原本輸出
string中的空格能原本輸出
2016-03-03
function openWindow(){
var opencheck = confirm("Are you sure to open a new web?");
if(opencheck=true){
var web_addr=prompt("Please enter the site","http://www.xianlaiwan.cn/");
window.open(web_addr,'_blank','width=400,height=500');
}
}
var opencheck = confirm("Are you sure to open a new web?");
if(opencheck=true){
var web_addr=prompt("Please enter the site","http://www.xianlaiwan.cn/");
window.open(web_addr,'_blank','width=400,height=500');
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8";>
<title>reshen</title>
</head>
<body>
<p id="p1">1111</p>
<p id="p2">2222</p>
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8";>
<title>reshen</title>
</head>
<body>
<p id="p1">1111</p>
<p id="p2">2222</p>
<script type="text/javascript">
document.write("hello");
document.getElementById("p1").style.color="blue";
</script>
</body>
</html>
2016-03-02