JSFiddle - React, Tailwind, and code Playground

HTML

<a href="http://example.com" target="_blank">Example.com</a> (this won't be selected)
<br>
<a href="https://google.com" target="_blank">https://google.com</a> (this <strong>will</strong> be selected)
<br>
<a href="http://wikipedia.org" target="_blank">Wikipedia.org</a> (this won't either)
<br>
<a href="http://wikipedia.org/logo.png" target="_blank">.png link</a> (and this <strong>will</strong> be selected)

JavaScript

var anchors = document.querySelectorAll('a[href^="https://"], a[href$=".png"]');
Array.prototype.forEach.call(anchors, function (element, index) {
    element.href = "http://stackoverflow.com";
});