<script type="text/javascript">
var mychar= document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello word";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
var mychar= document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello word";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
2016-04-23
<!doctype html>
<html>
<head>
<mate http-equiv="Content-type" content="text/html charset=UTF-8"/>
<title>hello</title>
</head>
<body>
<h1>你說茲瓷不茲瓷</h1>
<h2>圖樣圖森破</h2>
<h3>無可奉告</h3>
<p>你們這些年輕人</p>
</body>
</html>
<html>
<head>
<mate http-equiv="Content-type" content="text/html charset=UTF-8"/>
<title>hello</title>
</head>
<body>
<h1>你說茲瓷不茲瓷</h1>
<h2>圖樣圖森破</h2>
<h3>無可奉告</h3>
<p>你們這些年輕人</p>
</body>
</html>
<script type="text/javascript">
function hidetext()
{
var mychar = document.getElementById("con"); mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
function hidetext()
{
var mychar = document.getElementById("con"); mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con").style.display="block";
}
2016-04-23
function openWindow(){
var yon=confirm("yes or no");
if(yon==true){
var web=prompt("請輸入","http://www.baidu.com");
window.open(web,"_blank","width=400,height=500");
}
else
var yon=confirm("yes or no");
if(yon==true){
var web=prompt("請輸入","http://www.baidu.com");
window.open(web,"_blank","width=400,height=500");
}
else
<script type="text/javascript">
var mystr="我是";
var mychar="JavaScript";
document.wtite(mychar+"<br/>");
document.write(mystr+mychar+"的忠實粉絲")
</script>
var mystr="我是";
var mychar="JavaScript";
document.wtite(mychar+"<br/>");
document.write(mystr+mychar+"的忠實粉絲")
</script>
2016-04-22
var div=document.getElementById("txt");
div.style.color="red";
div.style.width="500";
div.style.height="500";
//定義"隱藏內容"的函數
div.style.display="none";
div.style.display="block";
function rec(){
var set=confirm("是否取消設置");
if(set==yes){
div.removeAttribute("style");
}
else{
}
div.style.color="red";
div.style.width="500";
div.style.height="500";
//定義"隱藏內容"的函數
div.style.display="none";
div.style.display="block";
function rec(){
var set=confirm("是否取消設置");
if(set==yes){
div.removeAttribute("style");
}
else{
}
function openWindow(){
// 新窗口打開時彈出確認框,是否打開
alert("執行");
var message=confirm("是否打開新窗口?");
if(message==true){
var wangye=prompt("請確認打開的網頁:","http://www.xianlaiwan.cn/");
if(wangye !=null)
window.open(wangye,"_blank","width=400,height=500,menubar=no,toolbar=no");
}
// 新窗口打開時彈出確認框,是否打開
alert("執行");
var message=confirm("是否打開新窗口?");
if(message==true){
var wangye=prompt("請確認打開的網頁:","http://www.xianlaiwan.cn/");
if(wangye !=null)
window.open(wangye,"_blank","width=400,height=500,menubar=no,toolbar=no");
}