【问题标题】:Setting OPTGROUP label with jquery使用 jquery 设置 OPTGROUP 标签
【发布时间】:2018-03-10 09:47:39
【问题描述】:

我很难找到如何使用 Jquery 按 ID 更改我的 opt 标签:

我尝试了以下方法,但没有成功:

$("#o1").attr('label').change('New DAY') ;

还有这个:

 $("#o1").attr('label').append('New DAY'); 

这是我的html:

<select class="form-control" id="dropdown_appointment">
                        <option value="choose">Choisir le Rendez-vous.  </option>
                        <optgroup label="Lundi" id="o1">
                        </optgroup>
                        <optgroup label="Mardi" id="o2">
                        </optgroup>
                        <optgroup label="Mercredi" id="o3">
                        </optgroup>
                        <optgroup label="Jeudi" id="o4">
                        </optgroup>
                        <optgroup label="Vendredi" id="o5">
                        </optgroup>
                        <optgroup label="Samedi" id="o6">
                        </optgroup>

                    </select> <br><br>

也许你有一个想法?

非常感谢,祝你有美好的一天......

【问题讨论】:

    标签: jquery select optgroup


    【解决方案1】:
    $("#o1").attr('label','New DAY');
    

    希望对你有帮助

    【讨论】:

    • 非常感谢,我明天试试
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-19
    • 2017-10-29
    相关资源
    最近更新 更多