gpt4 book ai didi

javascript - 如何正确使用.removeClass

转载 作者:行者123 更新时间:2023-12-03 06:47:04 25 4
gpt4 key购买 nike

var increment = 0;

$("#dial-save").click(function(){
$(".add-flow").html("");
$(".add-flow").append("<button type='button' class='btn btn-w-s btn-ivr'><i class='fa fa-hand-o-down p-xxs' aria-hidden='true'></i>Dial</button>");

switch(increment) {
case 0:
$(".flow-preview").append("<div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-10 add-flow'><button type='button' class='btn add-applet' data-toggle='modal' data-target='#myModalAddApplet'>Add Applet</button></div>");
increment++;
$("#myModalAppletDial").modal('hide');
$( ".add-flow:first-child" ).removeClass("add-flow");
break;

case 1:
$(".flow-preview").append("<div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-9 add-flow'><button type='button' class='btn add-applet' data-toggle='modal' data-target='#myModalAddApplet'>Add Applet</button></div>");
increment++;
$("#myModalAppletDial").modal('hide');
break;

};

});

我需要有关更改行 $( ".add-flow:first-child").removeClass("add-flow"); 的帮助。我在这里想做的是从所有标签中删除 add-flow 除了我要附加的标签之外......

最佳答案

尝试以下操作

switch(increment) {
case 0:
$('.flow-preview').find( ".add-flow" ).removeClass("add-flow");
$(".flow-preview").append("<div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-10 add-flow'><button type='button' class='btn add-applet' data-toggle='modal' data-target='#myModalAddApplet'>Add Applet</button></div>");
increment++;
$("#myModalAppletDial").modal('hide');
break;

case 1:
$(".flow-preview").append("<div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-1'></div><div class='col-md-9 add-flow'><button type='button' class='btn add-applet' data-toggle='modal' data-target='#myModalAddApplet'>Add Applet</button></div>");
increment++;
$("#myModalAppletDial").modal('hide');
break;

};

关于javascript - 如何正确使用.removeClass,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37694147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com