我有一個由CRM生成的表單。Jquery .children() - 父級擁有獨特的類,子級具有非唯一類,選擇子級
<fieldset><legend>Publish Name in Newspaper
</legend>
<div class="crm-section custom_67-section"><div class="label"><label> Check here if we may release your name and contribution levels
<span class="crm-marker" title="This field is required.">*</span>
</label></div>
<div class="content">
<input value="1" type="radio" id="CIVICRM_QFID_1_20" name="custom_67" class="form-radio" />
<label for="CIVICRM_QFID_1_20">Yes</label>
<input value="0" type="radio" id="CIVICRM_QFID_0_22" name="custom_67" class="form-radio" />
<label for="CIVICRM_QFID_0_22">No</label></div>
<div class="clear"></div></div></fieldset>
由於類「標籤」使用的形式反覆其他地方,我只是需要選擇div class="crm-section custom_67-section"
內div class='label'
。
這是我
jQuery(document).ready(function(){
jQuery(.'crm-section custom_67-section').children(.'label').attr("style","width:500px;");
});
'.'進入字符串中。 ''.crm-section.custom_67-section''.label'' – Musa 2013-05-02 21:37:59
'jQuery('.crm-section custom_67-section')' – 2013-05-02 21:38:32