JavaScript設定屬性

CodeAgriculture發表於2013-10-01
  
    
       function SetDisabled(obj) {
           obj.className = "put textReadonly";
           obj.disabled = 'disabled';
           obj.value = "";
       };
 
     
       function SetAbled(obj) {
           obj.removeAttribute('disabled');
           obj.removeAttribute('class', 'textReadonly');
           obj.className = "put";
       };
                 function SetRate() {
                     var rate = document.getElementById("");
                     var fix = document.getElementById("");
                     var byRate = document.getElementById("");
                     var byFix = document.getElementById("");
                     if (rate.checked == true) {
                         fix.checked = false;
                         SetDisabled(byFix);
                         SetAbled(byRate);
                     }
                     else {
                         SetDisabled(byRate);
                     } 
                 };
  

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28699126/viewspace-773666/,如需轉載,請註明出處,否則將追究法律責任。

相關文章