//So Easy.
function openWindow()
{
var test;
test = prompt("請輸入要打開的鏈接!");
if(test!='' && test!=null && test!=undefined ){
window.open(test,'_blank','width=400,height=500,menubar=no,boolbar=no');
}else{
alert('請輸入網址!');
}
}
function openWindow()
{
var test;
test = prompt("請輸入要打開的鏈接!");
if(test!='' && test!=null && test!=undefined ){
window.open(test,'_blank','width=400,height=500,menubar=no,boolbar=no');
}else{
alert('請輸入網址!');
}
}
<script type="text/javascript">
var age=prompt("請輸入你的年齡!")
if age(<18)
{document.write("你是未成年!");}
else if(age>18)
{document.write("你是成年人!");}
else if(age>24)
{document.write("你可以結婚了哦");}
else{document.write("你老了噢!");}
</script>
var age=prompt("請輸入你的年齡!")
if age(<18)
{document.write("你是未成年!");}
else if(age>18)
{document.write("你是成年人!");}
else if(age>24)
{document.write("你可以結婚了哦");}
else{document.write("你老了噢!");}
</script>
2016-06-16
function rec(){
var mymessage= confirm("你是可愛的妹紙嗎?") ;
if(mymessage==true)
{
alert("約嗎!");
}
else
{
alert("沒關系 只要你不是大叔就行!");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="妹子點我!" />
</body>
</html>
var mymessage= confirm("你是可愛的妹紙嗎?") ;
if(mymessage==true)
{
alert("約嗎!");
}
else
{
alert("沒關系 只要你不是大叔就行!");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="妹子點我!" />
</body>
</html>
2016-06-15
在這測試了半天都不行,自己新建了.html文檔一試就OK。我也是醉了
function openWindow(){
var myurl;
var mywin = confirm("是否打開一個新窗口");
if (mywin==true){
myurl = prompt("輸入要打開的網址:","http://www.xianlaiwan.cn");
window.open(myurl,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
}
function openWindow(){
var myurl;
var mywin = confirm("是否打開一個新窗口");
if (mywin==true){
myurl = prompt("輸入要打開的網址:","http://www.xianlaiwan.cn");
window.open(myurl,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
}
}
var a=document.getElementById('con')獲取到的只是擁有該ID的對象,想要知道獲取的是什么標簽可以document.write(a.tagName)
2016-06-15
這網站確實很吊,感覺簡單易懂,我覺得比w3cshool要簡單多了,我現在學起來再沒有看w3cshool那么吃力了,其實這個如果是視頻的話,那我估計能看懂的人不多,如果自己的代碼哪里錯了,還可以看其他同學提交的代碼,這樣就知道哪里出問題了,果然不錯,網站整個用戶體驗也做得非常的好,真心希望你們繼續做好做大,實在是太強大了,哈哈哈!
2016-06-15