我有以下代码
<div class="col-md-3">
<label for="transmittal_transmittal_titles_attributes_<%= index %>_title_language" class="control-label">
Pub Date
</label>
<select class="form-control select_boxes"
id="transmittal_transmittal_titles_attributes_<%= index %>_pub_date_options"
name="transmittal[transmittal_titles_attributes][<%= index %>][title_language]">
<%= options_for_select(@pub_date_options) %>
</select>
</div>
<div id="pub-date-picker" class="col-md-3">
<label for="transmittal_transmittal_titles_attributes_<%= index %>_pub_date" class="control-label">
Select a Pub Date
</label>
<div class="input-group date">
<input type="text"
id="transmittal_transmittal_titles_attributes_<%= index %>_pub_date"
name="transmittal[transmittal_titles_attributes][<%= index %>][pub_date]"
value="<%= StringUtils.format_date tt.pub_date %>"
data-title="<%= tt.title %>"
class="form-control transmittal-title-pub-date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
来自&#34; select_boxes&#34;如何遍历以查找最接近的输入组日期?
答案 0 :(得分:1)
您可以使用:
$('.select_boxes').parent().next().find('.input-group.date');