title: ins1.addEventListener is not a function
body: <p>I am recently having a problem with javascript code. The script changes its <code>&lt;ins data-ad-slot="4092520690"&gt;</code> paramater to <code>&lt;ins data-ad-slot-"9020596432"&gt;</code> after 3 clicks. But there is a slight console error. 
  It says that 'ins1.addEventListener is not a function'.</p>
  
  <p>The error: <img src="https://i.imgur.com/VHBfxZa.png" alt="error"></p>
  
  <p>The javascript code: </p>
  
  <pre><code>$(document).ready(function(){
          if(sessionStorage.getItem('ins')){
              const ins1 = document.getElementsByTagName('4092520690');
              var newIns = sessionStorage.getItem('ins');
              var newParam = sessionStorage.getItem('param')
              ins1.param = newParam;
              ins1.innerText = newIns;
          }
      });
  
      function replaceAfter3Clicks(elem, newElem) {
          let count = 0;
          ins1.addEventListener('click', () =&gt; {
              count ++;
              if (count === 3) {
                  sessionStorage.clear(); // Clear all sessionStorage
                  sessionStorage.setItem('ins', "ins 2"); // First param is the name and the second is the value
                  sessionStorage.setItem('data-ad-slot', "4092520690");// First param is the name and the second is the value
                  elem.parentNode.replaceChild(newElem, elem);
              }
           });
      }
  
      const ins1 = document.getElementsByTagName('4092520690');
  
      // pre-made second div for future replacement
      const ins2 = document.createElement('ins');
      ins2.param = '9020596432';
      ins2.innerText = 'ins 2';
      replaceAfter3Clicks(ins1, ins2);
  </code></pre>
  
  <p>Could somebody maybe enlighten me what the problem is with line</p>
  
  <p><code>ins1.addEventListener('click', () =&gt; {</code>
  and
  <code>replaceAfter3Clicks(ins1, ins2);</code> is.</p>