function openWindow()
{
var open = confirm ("確認繼續?");
if (open)
{ var url=prompt("輸入網址:","http://www.xianlaiwan.cn/");
window.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no');}
else {alert("你已經取消");}
}
{
var open = confirm ("確認繼續?");
if (open)
{ var url=prompt("輸入網址:","http://www.xianlaiwan.cn/");
window.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no');}
else {alert("你已經取消");}
}
function openWindow()
{ var con =confirm("你確定要打開");
if(con)
{
var ulr = prompt("請輸入要打開的網址");
if(ulr == ""){
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500');
}else
{
window.open(ulr,'_blank','width=400,height=500');
}
}if(con ==false)
{
alert("已取消");
}
}
{ var con =confirm("你確定要打開");
if(con)
{
var ulr = prompt("請輸入要打開的網址");
if(ulr == ""){
window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500');
}else
{
window.open(ulr,'_blank','width=400,height=500');
}
}if(con ==false)
{
alert("已取消");
}
}
<script type="text/javascript">
function hidetext()
{
var mychar = document.getElementById("con");
mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
</script>
function hidetext()
{
var mychar = document.getElementById("con");
mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
</script>
2015-05-03
<script type="text/javascript">
var mychar=document.getElementById("con");
document.write("結果:"+mychar); //輸出獲取的P標簽。
</script>
var mychar=document.getElementById("con");
document.write("結果:"+mychar); //輸出獲取的P標簽。
</script>
2015-05-03