”取消設(shè)置“函數(shù)怎么寫(xiě)
function txt(){
? ? var e=document.getElementById("txt");
? ? ? e=confirm("是否取消");
? ? ? if(e=true){
然后怎么寫(xiě),這樣寫(xiě)對(duì)不對(duì)。
??
? ? ? ? ??
function txt(){
? ? var e=document.getElementById("txt");
? ? ? e=confirm("是否取消");
? ? ? if(e=true){
然后怎么寫(xiě),這樣寫(xiě)對(duì)不對(duì)。
??
? ? ? ? ??
2015-06-11
舉報(bào)
2015-06-12
? <script type="text/javascript">
? ? var p1=document.getElementById("txt"); ? ?
//定義"改變顏色"的函數(shù)
? ?function dcolor(){
? ? ?
? ? ? p1.style.color="#f0f";
? ? ? p1.style.background="#0ff";
? ?}
//定義"改變寬高"的函數(shù)
? ? ?function modifyWH(){
? ? ? p1.style.width="400px";
? ? ? p1.style.height="500px";
? ? ?}
//定義"隱藏內(nèi)容"的函數(shù)
? ? ?function hide(){
? ? ? ?p1.style.display="none";
? ? ?}
//定義"顯示內(nèi)容"的函數(shù)
? ? ? function show(){
? ? ? ? p1.style.display="block";
? ? ? ?}
//定義"取消設(shè)置"的函數(shù)
function comFirm(){
? ? var m1=confirm("是否取消設(shè)置");
? ? ? ? ?if(m1==true){
? ? ? ? p1.style.color="#000";
? ? ? ? p1.style.backgroundColor="#fff";
? ? ? ? p1.style.height="400px";
? ? ? ? p1.style.width="600px";
? ? ? ? p1.style.display="block";
? ? ? ? ? ? }
? ? ? }
? </script>
2016-05-31
取消設(shè)置,可以 把前面設(shè)置的在還原一下
2015-06-11
右側(cè)有源碼可以參考,在同學(xué)代碼區(qū)域也可以參考其他同學(xué)的代碼