Javascript Popup Reset

Sorry I’m pretty hopeless with Javascript. I have a script that shows a popup which then fades out. But I cannot get it to reset. The code as it stands only works once.

function myFunction$users5() {
  var pop = document.getElementById("myPopup$users5");
  pop.classList.add("show");


  setTimeout(function() {
    $('#myPopup$users5').fadeOut('fast', function() {

      pop.classList.remove("show");
    });
  }, 3000);
}
<div class="popup" onclick="myFunction'.$users5.'()"><img src="unlovesm.png" style="float:right"><span class="popuptext" id="myPopup'.$users5.'">Login to Like.</span></div>

The popup shows and fades out correctly but thats it. Clicking the div again doesn’t show the popup a second time.