我正在尝试从一组div上包含的三个输入中获取值,但只有不属于这些的ediv invisible-age-range-row
<div class="row">
<div class="col-md-7 col-xs-12 dist-element-row">
<label>Franjas de edad</label>
<div class="row age-range-row">
<div class="col-md-2">
<label>Desde</label>
<input type="number" min="0" class="form-control from" value="1">
</div>
<div class="col-md-2">
<label>Hasta</label>
<input type="number" min="0" class="form-control to" value="2">
</div>
<div class="col-md-2">
<label>%</label>
<input type="number" min="0" max="100" class="form-control percentage" value="20">
</div>
<div class="col-md-6 options-cell">
<button class="btn btn-primary add-range">+</button>
<button class="btn btn-default delete-range">-</button>
</div>
我这样得到的div
var ranges = $('.age-range-row').not('.invisible-age-range-row');
但是我不能以这种方式访问输入值:
ranges.each(function(range) {
var elements = [];
console.log(range);
elements.push(range.find('.from'));
elements.push(range.find('.to'));
elements.push(range.find('.percentage'));
stored_ranges.push(elements);
});
大话西游666
相关分类