i'm trying to retrieve a data value which is dynamically added by an input field. but this value is not updated with .on
<div class="box" data-box="7532 7533 7534">
<input type="number" class="number_box">
</div>
$(document).on('keyup', '.number_box ', ' .pdt-pn', function() {
$box = $(this).val();
console.log( $(this).closest('.box').data('box'));
$boxplus = $(this).closest('.box').data('box') + $box;
$(this).closest('.box').attr('data-box', $boxplus);
});
my console.log retrieve always the same number but no with the new value. See in fiddle https://jsfiddle.net/r4kqsjga/1/
i don't anderstand ! thnak's for your help