取消設置?。。?!
//定義"取消設置"的函數 function changeConfirm(){ ? styles = document.getElementById("txt"); ? ?var changes = confirm("確定取消設置嗎?"); ? ?if(changes==true){ ? ? ? ?styles.removeAttribute("style"); ? ?}else{ ? ? ? ?document.write("取消操作"); ? ?} }
//定義"取消設置"的函數 function changeConfirm(){ ? styles = document.getElementById("txt"); ? ?var changes = confirm("確定取消設置嗎?"); ? ?if(changes==true){ ? ? ? ?styles.removeAttribute("style"); ? ?}else{ ? ? ? ?document.write("取消操作"); ? ?} }
2018-03-09
舉報
2018-03-31
? var text=document.getElementById("txt");
? var defaultSettings=text.style;
//定義"取消設置"的函數
function restoreSetting(){
??? var ret=confirm("取消設置,恢復默認值?");
??? if(ret){
?????? text.style=defaultSettings;
??? }
}
2018-03-09
var txt=document.getElementById("txt");
? ?var set={
? ? changeColor:function(){
? ? ? ? txt.style.color="red";
? ? ? ? txt.style.backgroundColor="#ccc";
? ? },
? ? changeSize:function(){
? ? ? ? txt.style.width="300px";
? ? ? ? txt.style.height="300px";
? ? },
? ? objHide:function(){
? ? ? ? txt.style.display="none";
? ? },
? ? objShow:function(){
? ? ? ? txt.style.display="block";
? ? },
? ? offSet:function(){
? ? ? ? var message=confirm("你確定要重置所有設置么?");
? ? ? ? if(message==true){
? ? ? ? ? ? txt.removeAttribute('style');
? ? ? ? }
? ? }
? }