title: Javascript undefined element on adding EventListener
body: <p>Have a class:</p>
  <pre><code>'use strict'
  
  class modal{
      modal_wnd;
      close;
      constructor(){
          this._init();
      }
  
      _init(){
          this.modal_wnd = document.getElementById('modal'); //div
          this.close = document.getElementById('mdl_close'); // span 'X'
          this.close.addEventListener('click', this.close_1);
      }
  
      show(){
          this.modal_wnd.style.visibility = 'visible';
      }
  
      close_1(){
          alert(this.close);
          this.modal_wnd.style.visibility = 'hidden';
      }
  }
  
  </code></pre>
  <p>Have div-element 'modal' and span 'X' in it. On a page have a button to show div:</p>
  <pre><code>bt_modal.addEventListener(&quot;click&quot;, function(){
                      let mdl = new modal();
                      mdl.show();
                  });
  </code></pre>
  <p>that works fine, but when I press 'X' - get such an error: Uncaught TypeError: Cannot read properties of undefined (reading 'style') at HTMLSpanElement.close_1. Can anyone explain why does it happen?</p>