I’m facing a little problem with some jQuery Code…
First, I have this code that works great :
$(".add_cheque").click(function() {
nb_cheque += 1;
var html = '<tr><td><input type="checkbox" checked="checked"></td><td><input type="text" name="montant'+nb_cheque+'" id="montant" value="Montant" /></td>';
$('#services_pack').append(html);
});
So now, I want to use the “montant” selector from the text input added to the page, with the keyup function… but it’s not working…
If I do something like :
$('#montant').keyup(function() {
alert('test keyup');
});
And I type something in the #montant input, nothing is happening…
Anyone ?
You’d need to have this event triggered after the #montant is added to the DOM
Or you could set up a live(.on/.delegate/.live/etc) event keypress