gpt4 book ai didi

javascript - 我如何添加或附加多个下拉菜单

转载 作者:行者123 更新时间:2023-11-28 01:50:02 26 4
gpt4 key购买 nike

<分区>

我的任务是在单击添加按钮时添加以前的表单。 enter image description here

当我点击“添加”按钮时,它将在每个下拉列表下方添加所有下拉列表,如图所示。

并删除一行(意味着一行中的所有 5 个下拉列表)。我将执行此功能。

问题是:

我们如何在每次点击添加按钮时追加或添加一行。

我的编码是:jQuery:

$(document).ready(function () {
$(".glyphicon").click(function () {
$(this).parents('.form-group').remove();
});
$(".add").click(function () {
$("form").parent(".form-group").add();
});
});

$(document).ready(function () {
$(".glyphicon").click(function () {
$(this).parents('.form-group').remove();
});
$(".add").click(function () {
$("form").parent(".form-group").add();
});
});

HTML:

<div class="form-group">        
<div class="col-sm-12" >
<div class="btn-group week">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">All days
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="week"><a href="#">Monday</a></li><li class="week"><a href="#">Tuesday</a></li>
<li class="week"><a href="#">Wednesday</a></li><li class="week"><a href="#">Thusday</a></li>
<li class="week"><a href="#">Friday</a></li><li class="week"><a href="#">Saturdayy</a></li>
<li class="week"><a href="#">Sunday</a></li>
</ul>
</div>
<div class="btn-group week">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Time
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="week"><a href="#">Monday-saturaday</a></li>
</ul>
</div>
<label for="exampleInputEmail1"> : </label>
<div class="btn-group week">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">.00
<span class="caret"></span>
</button>
<ul class="dropdown-menu" style="height: 10em;width:2em; overflow: auto;">
<li class=""><a href="#">.00</a></li><li class=""><a href="#">.01</a></li>
<li class=""><a href="#">.02</a></li><li class=""><a href="#">.03</a></li>
<li class=""><a href="#">.04</a></li><li class=""><a href="#">.05</a></li>
<li class=""><a href="#">.06</a></li><li class=""><a href="#">.07</a></li>
</ul>
</div>
<label for="exampleInputEmail1"> to </label>
<div class="btn-group week">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Time
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li class="week"><a href="#">Monday-saturaday</a></li>
</ul>
</div>
<label for="exampleInputEmail1"> : </label>
<div class="btn-group week">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">.00
<span class="caret"></span>
</button>
<ul class="dropdown-menu" style="height: 10em;width:2em; overflow: auto;">
<li class=""><a href="#">.00</a></li><li class=""><a href="#">.01</a></li>
<li class=""><a href="#">.02</a></li><li class=""><a href="#">.03</a></li>
<li class=""><a href="#">.04</a></li><li class=""><a href="#">.05</a></li>
<li class=""><a href="#">.06</a></li><li class=""><a href="#">.07</a></li>
</ul>
</div>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>

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