Javascript 从一个div中存在的三个div中选择前两个div
我想显示前两个字段,即车库报价金额和给定部门的报价金额,请帮助我。我是jquery的新手。 我已使用此条件来显示以下条件Javascript 从一个div中存在的三个div中选择前两个div,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,我想显示前两个字段,即车库报价金额和给定部门的报价金额,请帮助我。我是jquery的新手。 我已使用此条件来显示以下条件 $("#priceDifference div.row:not(:nth-of-type(3))").show(); 请用正确的方式告诉我 $("#priceDifference div.row:not(:nth-of-type(3))").show(); <div class="row" id="priceDifference" style="display:no
$("#priceDifference div.row:not(:nth-of-type(3))").show();
请用正确的方式告诉我
$("#priceDifference div.row:not(:nth-of-type(3))").show();
<div class="row" id="priceDifference" style="display:none;">
<div class="row">
<div class="col-lg-4 col-xs-1 col-lg-offset-1 form-group">
<label style="padding-top:5px;"> Quoted Price</label>
</div>
<div class="col-xs-4">
<div class="form-group">
<input type="number" name="quoted_amt" id="gobumpr_quoted_amt<?php echo $booking_id; ?>" class="form-control" style="max-width:280px;"/>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-1 col-lg-offset-1 form-group">
<label style="padding-top:5px;"> Garage Quoted Price</label>
</div>
<div class="col-xs-4">
<div class="form-group">
<input type="number" name="garage_quoted_amt" id="garage_quoted_amt<?php echo $booking_id; ?>" class="form-control" style="max-width:280px;"/>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-1 col-lg-offset-1 form-group">
<label style="padding-top:5px;"> Local Garage Quote</label>
</div>
<div class="col-xs-4">
<div class="form-group">
<input type="number" name="local_garage_quoted_amt" id="local_garage_quoted_amt<?php echo $booking_id; ?>" class="form-control" style="max-width:280px;"/>
</div>
</div>
</div>
</div>
1.删除样式=显示:无;来自父div
$("#priceDifference div.row:not(:nth-of-type(3))").show();
2.使用
$("#priceDifference div.row:not(:nth-of-type(3))").show();
工作代码段:-
$("#priceDifference div.row:not(:nth-of-type(3))").show();
$document.readyfunction{
$priceDifference.row:gt1.hide;
};
GoBumpr报价
不能显示隐藏元素的子元素。元素隐藏后,其所有子元素都将隐藏。您可以做的是显示父容器并隐藏其所有子容器(需要显示的子容器除外)
$("#priceDifference div.row:not(:nth-of-type(3))").show();
可能在不想显示的行上添加一个隐藏类,并将该类添加到css中,如.hidden{display:none;}或者将其样式设置为显示:与您对父行所做的操作不同,无需直接以html格式显示。@GopalNaikGuguloth很高兴为您提供帮助::当我选择同一个div时,需要显示所有字段,但只显示两个文件。请您帮助我。@GopalNaikGuguloth当我选择同一个div->您的意思是什么?具有相同id的div?具有价格差异的div包含3个字段。从三开始,我们隐藏了最后一个字段,但现在我想在下拉列表中显示一个值的所有三个字段,我在这里没有提到。问题是,在显示两个字段之后,我需要显示所有三个字段,即本地\车库\报价\金额@Dieth还活着我需要在显示两个字段之后显示所有三个字段,这三个字段也是本地字段。
$("#priceDifference div.row:not(:nth-of-type(3))").show();