2015-11-26 64 views
0

我不能夠更改父div標籤名稱(DIV CLASS =「pc_flex_form_line_container」)我怎麼能隱藏街道地址整個div塊,只顯示公司塊?

<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

'$( 'pc_flex_form_line_container:EQ(1)'。)隱藏();'。 – DelightedD0D

回答

0

如果街道地址全DIV塊你指的是第二個元素與類pc_flex_form_line_container。你可以這樣說:

$('.pc_flex_form_line_container:eq(1)').hide();
<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>