我无法更改父div标签名称(div class =" pc_flex_form_line_container")
<div class="pc_flex_form_line_container">
<div class="pc_flex_form_label_item">Company
</div>
<div class="pc_flex_form_required_flag_item"><img src="/corestrengths/s.gif" class="requiredFieldMarker" />
</div>
<div class="pc_flex_form_field_item"><input id="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingcompany" type="text" name="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingcompany" class="pc_medium_input_field" />
</div>
</div>
<div class="pc_flex_form_line_container">
<div class="pc_flex_form_label_item">Street Address
</div>
<div class="pc_flex_form_required_flag_item"><img src="/corestrengths/s.gif" class="requiredFieldMarker" />
</div>
<div class="pc_flex_form_field_item"><input id="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingstreet" type="text" name="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingstreet" class="pc_long_input_field" />
</div>
</div>
答案 0 :(得分:0)
如果通过街道地址整个div块,则表示具有类pc_flex_form_line_container
的第二个元素。你可以这样做:
$('.pc_flex_form_line_container:eq(1)').hide();
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="pc_flex_form_line_container">
<div class="pc_flex_form_label_item">Company
</div>
<div class="pc_flex_form_required_flag_item"><img src="/corestrengths/s.gif" class="requiredFieldMarker" />
</div>
<div class="pc_flex_form_field_item"><input id="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingcompany" type="text" name="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingcompany" class="pc_medium_input_field" />
</div>
</div>
<div class="pc_flex_form_line_container">
<div class="pc_flex_form_label_item">Street Address
</div>
<div class="pc_flex_form_required_flag_item"><img src="/corestrengths/s.gif" class="requiredFieldMarker" />
</div>
<div class="pc_flex_form_field_item"><input id="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingstreet" type="text" name="siteQuickEventRegPage:SiteTemplate:evtRegForm:attendeeInfoForms:2:mailingstreet" class="pc_long_input_field" />
</div>
</div>
&#13;