当范围内没有任何内容时,我想使用jquery隐藏范围。
我的问题是跨度包含<br />
,这导致我的跨度仍显示。
HTML
<div class="col-xs-12 col-md-4">
<h5><strong>Billing Address</strong></h5>
<p class="address-fields">
<span>@Model.BillingAddress.Name @Model.BillingAddress.Surname<br /></span>
<span>@Model.BillingAddress.CompanyName<br /></span>
<span>@Model.BillingAddress.AddressLine1<br /></span>
<span>@Model.BillingAddress.AddressLine2<br /></span>
<span>@Model.BillingAddress.AddressLine3<br /></span>
<span>@Model.BillingAddress.City<br /></span>
<span>@Model.BillingAddress.StateTitle<br /></span>
<span>@Model.BillingAddress.PostCode<br /></span>
<span>@Model.BillingAddress.CountryName</span>
</p>
</div>
JQUERY
$('.address-fields span:empty').hide();