I'm trying to attach a jQuery plugin to a dynamically generated button. I've tried the following with no success:
$('.myButton').live('click', function() {
$(this).file().choose(function(e, input) {
// ...
});
});
I guess this doesn't work as the plugin needs binding before click.
So I tried...
$('.myButton').load(function() { ... });
and (getting desperate now)...
$('.myButton').live('load', function() { ... });
What method can I use to bind a newly generated button before the user clicks on it?