”取消設置“函數怎么寫
function txt(){
? ? var e=document.getElementById("txt");
? ? ? e=confirm("是否取消");
? ? ? if(e=true){
然后怎么寫,這樣寫對不對。
??
? ? ? ? ??
function txt(){
? ? var e=document.getElementById("txt");
? ? ? e=confirm("是否取消");
? ? ? if(e=true){
然后怎么寫,這樣寫對不對。
??
? ? ? ? ??
2015-06-11
舉報
2015-06-12
? <script type="text/javascript">
? ? var p1=document.getElementById("txt"); ? ?
//定義"改變顏色"的函數
? ?function dcolor(){
? ? ?
? ? ? p1.style.color="#f0f";
? ? ? p1.style.background="#0ff";
? ?}
//定義"改變寬高"的函數
? ? ?function modifyWH(){
? ? ? p1.style.width="400px";
? ? ? p1.style.height="500px";
? ? ?}
//定義"隱藏內容"的函數
? ? ?function hide(){
? ? ? ?p1.style.display="none";
? ? ?}
//定義"顯示內容"的函數
? ? ? function show(){
? ? ? ? p1.style.display="block";
? ? ? ?}
//定義"取消設置"的函數
function comFirm(){
? ? var m1=confirm("是否取消設置");
? ? ? ? ?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
取消設置,可以 把前面設置的在還原一下
2015-06-11
右側有源碼可以參考,在同學代碼區域也可以參考其他同學的代碼