$('#input').on( 'change', function(){ alert( $(this).val()); } ); $('#btn').click(function(){ $('#input').val( time() ); });