2016-01-21 110 views
-1

我有以下代碼。我想從這個結果中刪除所有selected類。我想從qulidd這一課做到這一點。從子類中刪除類名稱

<div class="search_slct2 qulidd"> 
    <select id="degree" multiple="multiple" name="degree" class="jqmsLoaded" style="display: none;"> 
     <option value="1">BE</option> 
     <option selected="" value="4">MBA</option> 
     <option selected="" value="2">MCA</option> 
     <option value="3">ME</option> 
    </select> 
    <div class="ms-options-wrap" style="position: relative;"> 
     <button>MBA, MCA</button> 
     <div class="ms-options" style="min-height: 200px; max-height: 200px; overflow: auto; display: none;"> 
      <ul style="-moz-column-gap: 0px;"> 
       <li> 
        <label for="ms-opt-241" style="padding-left: 37px;"> 
         <span class="custom-checkbox"> 
          <input type="checkbox" title="BE" value="1" id="ms-opt-241" style=""> 
         </span> 
         BE 
        </label> 
       </li> 
       <li class="default selected"> 
        <label for="ms-opt-242" style="padding-left: 37px;"> 
         <span class="custom-checkbox selected"> 
          <input type="checkbox" title="MBA" value="4" id="ms-opt-242" style=""> 
         </span> 
         MBA 
        </label> 
       </li> 
       <li class="default selected"> 
        <label for="ms-opt-243" style="padding-left: 37px;"> 
         <span class="custom-checkbox selected"> 
          <input type="checkbox" title="MCA" value="2" id="ms-opt-243" style=""> 
         </span> 
         MCA 
        </label> 
       </li> 
       <li> 
        <label for="ms-opt-244" style="padding-left: 37px;"> 
         <span class="custom-checkbox"> 
          <input type="checkbox" title="ME" value="3" id="ms-opt-244" style=""> 
         </span> 
         ME 
        </label> 
       </li> 
      </ul> 
     </div> 
    </div> 
</div> 
+2

看不到JS代碼 – Tushar

+1

你試過了什麼?什麼沒有用? – PKeno

回答

3

你可以像下面。

$('.qulidd').find('.selected').removeClass('selected'); 
2

使用可以使用.removeClass();方法

$("ur selector").removeClass("Classname");