大家來嘗一下新鮮的按鈕代碼<script type="text/javascript">
function F5win(){
var openwin=window.open("http://www.xianlaiwan.cn","_blank","width=200,height=200,top=200,left=200");openwin.close();}
</script>
</head>
<body>
<form>
<input type="button" name="button" value="點擊刷新網頁" onclick="F5win()"/>
</form>
function F5win(){
var openwin=window.open("http://www.xianlaiwan.cn","_blank","width=200,height=200,top=200,left=200");openwin.close();}
</script>
</head>
<body>
<form>
<input type="button" name="button" value="點擊刷新網頁" onclick="F5win()"/>
</form>
2016-03-09
window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,left=0,top=0'); 里面的值要用等于號,不能分號
2016-03-09
誤解了好久哦,一直以為x.innerHTML=""是需要document.wirte()才能在網頁上顯示的。我真是蠢得來一波又一波的。無語了
2016-03-09
function rec(){
var mymessage=confirm("你喜歡javascript嘛") ;
if(mymessage==true)
{
document.write("好的!");
}
else
{
rec();
}
}
哈哈哈有點厲害...
var mymessage=confirm("你喜歡javascript嘛") ;
if(mymessage==true)
{
document.write("好的!");
}
else
{
rec();
}
}
哈哈哈有點厲害...
2016-03-08
function openWindow(){
var check = confirm("確認打開窗口嗎?");
if(check){
var web=prompt("輸入網址:","www.xianlaiwan.cn")
window.open(web,'_ablank','with=400px,height=500px,menubar=no,toolbar=no');
}
else{
window.close();
}
}
var check = confirm("確認打開窗口嗎?");
if(check){
var web=prompt("輸入網址:","www.xianlaiwan.cn")
window.open(web,'_ablank','with=400px,height=500px,menubar=no,toolbar=no');
}
else{
window.close();
}
}
var id = document.getElementById("txt");
//定義"改變顏色"的函數
function a(){
id.style.color="red";
id.style.backgroundColor="#333";
}
//定義"改變寬高"的函數
function b(){
id.style.width="100px";
id.style.height="100px";
}
//定義"改變顏色"的函數
function a(){
id.style.color="red";
id.style.backgroundColor="#333";
}
//定義"改變寬高"的函數
function b(){
id.style.width="100px";
id.style.height="100px";
}
window.open("http://www.xianlaiwan.cn/","_blank","width=600,height=400,top=100,left=0");
2016-03-08