Define JQuery on fly
HTML
<div id="holder">
<button id='first'>first</button>
<div id="bulder">
</div>
</div>
JavaScript
$('#first').click(function () {
alert('first click');
$('#bulder').html("<input id='second' type='file' name='pic' accept='image/*'>");
$('#second').click(function () {
alert('second click');
});
});