Bind on(keyup) to dynamic elements in jQuery (Twitter Bootstrap + typehead)
For on()
to be able to delegate you have to call it on a static element that you know is always going to be there and then you pass the dynamic element like:
$('#static-parent').on('keyup', '#aDropdownID', function(ev){
// stuff happens
});
If you don't have a static parent element, then you can always use body
.
This works for me:
$(document).on('keyup', '#YourInputFieldId', function () {
//stuff happens
});