我有一个html表格如下
<div class="control-group" id="fields">
<label for="">Use this section to add as many execution steps as you would like for this test case.</label>
<div class="controls">
<form role="form" autocomplete="off" id="formStep">
<div class="entry input-group col-sm-12" style="margin-bottom:3px;">
<input class="form-control stepFields" name="fields[]" type="text" placeholder="test step">
</div>
<div class="entry input-group col-sm-12" style="margin-bottom:3px;">
<input class="form-control stepFields" name="fields[]" type="text" placeholder="test step">
</div>
<div class="entry input-group col-sm-12" style="margin-bottom:3px;">
<input class="form-control stepFields" name="fields[]" type="text" placeholder="test step">
</div>
<div class="entry input-group col-sm-12" style="margin-bottom:3px;">
<input class="form-control stepFields" name="fields[]" type="text" placeholder="test step">
</div>
</form>
<br>
</div>
</div>
我有以下JS(Jquery)
$('.controls form')
.not($(this).children('.entry').last()[0])
.remove();
我想要删除除了最后一个之外的所有类名为entry
的div?
谢谢
答案 0 :(得分:2)