JSFiddle - React, Tailwind, and code Playground

HTML

<a href="http://www.google.com">google</a>
<a href="http://www.msn.com">msn</a>

<a href="http://www.stackoverflow.com">
    <img src="http://www.waleoyediran.com/wp-content/uploads/2011/04/stackoverflow.png" />
</a>

<a href="/Page.htm">internal</a>

<a href="https://www.msn.com">https</a>

CSS

a.external {
    color:red;
    }

JavaScript

$(function(){
    $("a[href^='http://']:not(:has(img)),a[href^='https://']:not(:has(img))").addClass("external");
});