Dynamic Popup doesn't work after two back link

Hello there,

I have link on my navbar to open dynamic popup :

<a href="#" class="link" id="open_mypopup"><i class="fa fa-bars" aria-hidden="true"></i></a>

I generate and open the dynamic popup with this JS :

$$('#open_mypopup').on('click', function () {
    var mypopup = app.popup.create({
    content: '<div class="popup">'+
            '<div class="view">'+
            '<div class="page vertical-center" data-page="popup_change">'+
            '<div class="navbar">'+
            '<div class="navbar-inner">'+
            '<div class="left">'+
          '<a href="#" class="link popup-close"><i class="fa fa-times fa-lg" aria-hidden="true"></i></a>'+
          '<div class="title"></div>'+
          '<div class="page-content container_home ">'+
          '<div class="row row_home" align="center">'+
          '<div class="col-100"><a href="#" class="link changetype" data-type="type1">TYPE1</a></div>'+
          '<div class="col-100" style="height:15%;"></div>'+
          '<div class="col-100"><a href="#" class="link changetype" data-type="type2">TYPE2</a></div>'+



  var type=$$(this).attr('data-type');
  mypopup.on('close', function (popup) {
   alert("Type ="+type)

Everything works nice but if I navigate on two page and I going forward 2 times (to return to my home view) the js click on “open_mypopup” dosn’t works.

I don’t find any solution…
Do you have an idea to help me ?

Thank you !

All the best


change to

$$(document).on('click', '#open_mypopup', function () {