Here I have an example:
$('#key').on('click', function(){
  $('.task').html("<button id='key'>Button</button>"+Date());
})<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class='task'>
  <button id='key'>Button</button>
</div>How I can apply javascript for overwriting element and get different time for each button press?
 
    