I have a small problem with jQuery, I have the following order of divs:
$(document).on('click', '.btn_salvar_obg_acess_prazo', function() {
var data = $(this).prev('.acess_prazo_date').val();
alert(data);
});
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<span><?php echo $obrigacao_correspondente_nome ?></span>
</div>
<div class="col-md-6">
<input type="text" data-m='<?php echo $m_c ?>' data-a='<?php echo $a_c ?>' data-obg='<?php echo $obrigacao_correspondente ?>' value="<?php echo $data ?>" name="obg_acess_prazo" class="acess_prazo_date datepicker_full form-control">
<hr>
</div>
<div class="col-md-2">
<button class="btn btn-primary btn_salvar_obg_acess_prazo">Salvar</button>
<hr>
</div>
</div>
</div>
I have tried with '.find ()', '.parent ()', '.prev ()' and still can not, always results in 'undefined'.