Inserted elements do not use the event
Hi,
i've got this simple code:
-
$(function() {
$('.qty').blur(function(){
// get current qty value
var qtyValue = $(this).attr("value");
// populate the bonus value with the qty value
$(this).next().val(qtyValue);
// debug
console.info("Valor do QTY:" + qtyValue);
//console.info($(this).next());
});
$('#addmore').click(function(){
$('<tr><td><input class="qty" size="10" /><input size="10"/></td></tr>').appendTo('table#tabela');
});
});
the problem is that when i click the button ["#addmore"] it creates the new element.. but they dont respond to the blur event.
why???
