title: How to remove the link from all the a tags on a page with pure js?
body: <p>I'm trying to inject js to loop through all the a tags in a page and remove the href so that they don't go anywhere when clicked.</p>
  <p>For this issue, I can't use jquery. So I need to use it using vanilla js (pure js).
  Here's what I have so far:</p>
  <pre><code>document.querySelectorAll(&quot;a&quot;).forEach(ele =&gt; {
      var anchors = document.getElementsByTagName(&quot;a&quot;);
      for(var i =0; i &lt; anchors.length; i++)
      {       var myLink = anchors[i].getAttribute(&quot;href&quot;);
              anchors[i].setAttribute(&quot;href&quot;,&quot;&quot;);
      }
  });
  </code></pre>
  <p>I ran the code, but none of the href tags were changed. They are all still links. How to get all the a tags to not work as links?</p>
  <p>I'm also open to other solutions, like turning the a tags into divs, or something else.</p>