从子类中删除类名

remove class name from child class

本文关键字:删除 子类      更新时间:2023-09-26

我有下面的代码。我想从这个结果中删除所有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>

你可以像下面这样做。

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

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

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