1
<script type="text/javascript">
$('.l-row input[type="text"]').on('focusout', function() {
$agents=$(this).closest('.l-row');
var valu=$agents.attr('data-value');
var item=$(this).val(); // here, this will be the input element that just fired a focusout event.
alert(item);
var page_id="<?=$page=basename($_SERVER['PHP_SELF']); ?>";
$.ajax({
url: '<?=base_url()?>record_edit',
type: 'post',
data: 'id='+valu+'&page_id='+page_id,
success:function(data)
{
//alert(data);
}
});
});
</script>
This will attach focusout event handlers for all the inputs with "type=text" in ide the div with class="l-row"
Origanally found it here at Stackoverflow.