[免費福利1枚]領極客學院30天的VIP,平時30元,現在免費??梢钥慈?500節視頻課程,想學編程的小伙伴速來。時間有限:http://e.jikexueyuan.com/invite/index.html?ZnJvbV9jb2RlPVlORzVIVyZ1bmFtZT1xcV9iNG5qbWxhdCZjaGFubmVsPWludml0ZV9zaGFyZWJ1dHRvbl9kaXJlY3QwNA==
2016-01-25
上面說的寫法太麻煩
寫法二:
document.getElementById("con").style.color="red";
document.getElementById("con").style.backgroundColor="#ccc";
document.getElementById("con").style.width="600px";
寫法二:
document.getElementById("con").style.color="red";
document.getElementById("con").style.backgroundColor="#ccc";
document.getElementById("con").style.width="600px";
2016-01-24
<script type="text/javascript">
var mychar=document.getElementById("con"); ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello World!"
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
var mychar=document.getElementById("con"); ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello World!"
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
2016-01-24
function openWindow(){
var mywin=confirm("是否打開新的網站");
if(mywin==true){
var url=prompt("請輸入你要打開的網址:","http://www.xianlaiwan.cn")
window.open('url','_blank','toolbar=no,menubar=no,scrollbars=yes,width=400,height=500')
}
}
var mywin=confirm("是否打開新的網站");
if(mywin==true){
var url=prompt("請輸入你要打開的網址:","http://www.xianlaiwan.cn")
window.open('url','_blank','toolbar=no,menubar=no,scrollbars=yes,width=400,height=500')
}
}