在最開始先獲取了txt的style。也不知道這樣對不對。。。
var identify=document.getElementById("txt");
//定義"取消設置"的函數
function cancel(){
var myConfirm = confirm("Reset?");
if(myConfirm)
{
var begin=document.getElementById("txt");
begin.style=identify.style;
}
}
var identify=document.getElementById("txt");
//定義"取消設置"的函數
function cancel(){
var myConfirm = confirm("Reset?");
if(myConfirm)
{
var begin=document.getElementById("txt");
begin.style=identify.style;
}
}
function openWindow(){
var r1=confirm("是否打開?");
if (r1==true){
var r2=prompt("請輸入網址","http://www.xianlaiwan.cn/");
window.open(r2,"_blank",width=400px,height=500px,menubar=no,toolbar=no);
}
}
var r1=confirm("是否打開?");
if (r1==true){
var r2=prompt("請輸入網址","http://www.xianlaiwan.cn/");
window.open(r2,"_blank",width=400px,height=500px,menubar=no,toolbar=no);
}
}
function openWindow(){
var p1=confirm("是否打開新窗口");
if(p1==true)
{
var p2=prompt("打開什么網站","http://www.xianlaiwan.cn")
window.open(p2,'_blank','width=400','heigh=500','menubar=no','toolbar=no')
}
else
{ }
}
var p1=confirm("是否打開新窗口");
if(p1==true)
{
var p2=prompt("打開什么網站","http://www.xianlaiwan.cn")
window.open(p2,'_blank','width=400','heigh=500','menubar=no','toolbar=no')
}
else
{ }
}
document.write(mychar+"<br />");
document.write(mystr+mychar+"的忠實粉絲!")
document.write(mystr+mychar+"的忠實粉絲!")
2016-04-25
<script type="text/javascript">
function changecs(obj){
var bc="#CCC",c="red",w=300;
obj.style.backgroundColor=bc;
obj.style.color=c;
obj.style.width=w+"px";
}
var bt={};
bt=document.getElementById("con");
bt.innerHTML="我要成為程序員";
changecs(bt);
</script>
function changecs(obj){
var bc="#CCC",c="red",w=300;
obj.style.backgroundColor=bc;
obj.style.color=c;
obj.style.width=w+"px";
}
var bt={};
bt=document.getElementById("con");
bt.innerHTML="我要成為程序員";
changecs(bt);
</script>
2016-04-25