0

My HTML input is created in jQuery so no handlers by default comes with it. I am trying to get onproperty change

$('#input').delegate('input propertychange', function() {
console.log('Hello World');
});

or

$('#input').on('input propertychange', function() {
console.log('Hello World');
});

The expected behavior is that when I type into the input that is generated in jQuery, console.log returns the message. Both examples above don't work, any suggestions? Thanks!

EDIT:

I generate the input this way:

$('#container').append('<input type="text" id="inputidhere" value=""></input>');
GGD4V
  • 265
  • 3
  • 8
  • Show us how you generate it – Marco Salerno Mar 24 '17 at 13:32
  • I don't think you're looking for `input propertychange`, but perhaps something like on `keyup` or `blur`. Also, you can't add an event listener if that element is not already in the DOM. How did you create it ? – Waxi Mar 24 '17 at 13:35
  • Satpal marked it right. It was a duplicate. $('.container').append('
    '); $('#testbox').on('input propertychange', function() { console.log('yay'); }); did the trick.
    – GGD4V Mar 24 '17 at 13:51

0 Answers0