<script type="text/javascript">
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.background="#CCC";
mychar.style.width="300px"
</script>
var mychar= document.getElementById("con");
mychar.style.color="red";
mychar.style.background="#CCC";
mychar.style.width="300px"
</script>
2016-02-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-02-24
document.write("Hello"+"&nbsp");
document.write("world");
document.write("world");
2016-02-24
//定義"取消設置"的函數
function removest(){
var mychar=confirm("確定取消設置?");
if(mychar==true)
{ var xxx=document.getElementById("txt");
xxx.removeAttribute("style");}
else
{}
}
function removest(){
var mychar=confirm("確定取消設置?");
if(mychar==true)
{ var xxx=document.getElementById("txt");
xxx.removeAttribute("style");}
else
{}
}
function openWindow(){
var str = confirm("是否打開新網頁?");
if (str != null){
var address = prompt("請輸入地址:",'http://www.xianlaiwan.cn');
if(address != null){
window.open(address,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
var str = confirm("是否打開新網頁?");
if (str != null){
var address = prompt("請輸入地址:",'http://www.xianlaiwan.cn');
if(address != null){
window.open(address,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
}
}
<script type="text/javascript">
var mychar=document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="修改后的內容。。。";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
var mychar=document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="修改后的內容。。。";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
2016-02-23
<script type="text/javascript">
function rec(){
var mymessage=confirm("你想被日嗎");
if(mymessage==true)
{
document.write("騷逼?。。。。。。。。?amp;quot;);
}
else
{
document.write("臭逼?。。。。。?!");
}
}
</script>
function rec(){
var mymessage=confirm("你想被日嗎");
if(mymessage==true)
{
document.write("騷逼?。。。。。。。。?amp;quot;);
}
else
{
document.write("臭逼?。。。。。?!");
}
}
</script>
2016-02-23