css - Jquery .children() -- parent has unique class, child has nonunique class, select child -
i have form generated crm.
<fieldset><legend>publish name in newspaper </legend> <div class="crm-section custom_67-section"><div class="label"><label> check here if may release name , contribution levels <span class="crm-marker" title="this field 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>
since class "label" used repeatedly elsewhere in form, need select div class='label'
inside div class="crm-section custom_67-section"
.
this have
jquery(document).ready(function(){ jquery(.'crm-section custom_67-section').children(.'label').attr("style","width:500px;"); });
multiple class selector same element uses multiple dots.
jquery('.crm-section.custom_67-section')
.'
invalid syntax .. should '.
instead.
finally, should use .css
set styles rather updating style attribute.
Comments
Post a Comment