<script type="text/javascript">
function openWindow(){
var my;
my=confirm("OPEN A NEW WEB?");
if(my==true){
var web;
web=prompt("which web?","http://www.xianlaiwan.cn/");
window.open(web,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
}
</script>
function openWindow(){
var my;
my=confirm("OPEN A NEW WEB?");
if(my==true){
var web;
web=prompt("which web?","http://www.xianlaiwan.cn/");
window.open(web,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
}
</script>
function openWindow(){
confirm("Open a new window?");
// 新窗口打開時彈出確認框,是否打開
prompt("Please enter the URL","http://www.xianlaiwan.cn");
// 通過輸入對話框,確定打開的網址
window.open("http://www.xianlaiwan.cn","_block","width:400px height:500px menubar=no toolbar=no");
}
confirm("Open a new window?");
// 新窗口打開時彈出確認框,是否打開
prompt("Please enter the URL","http://www.xianlaiwan.cn");
// 通過輸入對話框,確定打開的網址
window.open("http://www.xianlaiwan.cn","_block","width:400px height:500px menubar=no toolbar=no");
}
Object.className=classname(classname 為css樣式中的樣式名)
獲取元素class屬性
微網頁內的某個元素制定一個css樣式來更改該元素的外觀
獲取元素class屬性
微網頁內的某個元素制定一個css樣式來更改該元素的外觀
2016-04-06
object.style.display=value;
Object是獲取的元素對象,如通過document.getElementById("id")獲取的元素
Object是獲取的元素對象,如通過document.getElementById("id")獲取的元素
2016-04-06
注意大小寫?。?!
<script type="text/javascript">
function Wopen(){
window.open('http://www.xianlaiwan.cn','_blank','height=600,width=400,top=100,left=0');
}
</script>
<script type="text/javascript">
function Wopen(){
window.open('http://www.xianlaiwan.cn','_blank','height=600,width=400,top=100,left=0');
}
</script>
2016-04-06
object.innerHTML
Object是獲取的元素的對象,如通過document.getElementById("id")來獲得;
innerHTML嚴格區分大小寫
通過id="con"獲取p元素
通過id.innerHTML來修改HTML中的輸出內容
Object是獲取的元素的對象,如通過document.getElementById("id")來獲得;
innerHTML嚴格區分大小寫
通過id="con"獲取p元素
通過id.innerHTML來修改HTML中的輸出內容
2016-04-06
document.write(mychar+"<br>");
document.write(mystr+mychar+"的忠實粉絲!");
document.write(mystr+mychar+"的忠實粉絲!");
2016-04-06
var mynum;
mynum=8;
//alert("mynum="+mynum);
document.write("mynum = "+mynum);
mynum=8;
//alert("mynum="+mynum);
document.write("mynum = "+mynum);
2016-04-06
1.變量必須使用字母、下劃線(_)或者美元符($)開始。
2.然后可以使用任意多個英文字母、數字、下劃線(_)或者美元符($)組成。
3.不能使用JavaScript關鍵詞與JavaScript保留字。
2.然后可以使用任意多個英文字母、數字、下劃線(_)或者美元符($)組成。
3.不能使用JavaScript關鍵詞與JavaScript保留字。
2016-04-06