I have divs with the class 'well'. I loop all the divs to get the unique numbers and put them to an array in jquery. And that works.
But there is also an input object and I will get the value in the same loop. I will find the value on dom element. Does anybody know how to do that?
<div class="well" id=media$[unique number]>
<div class="row">
<div class="col-md-2">
<div class="mediabank-input">
<input id="caption" name="caption" class="form-control" type="text” />
</div>
</div>
</div>
</div>
jquery code:
var mediaIdsArray = [];
$('#media-grid .well').each(function (index) {
var id = $(this).attr('id');
var split_id = id.split("&");
mediaIdsArray.push(split_id[1]);
});