JSFiddle - React, Tailwind, and code Playground

by Sameera Thilakasiri

HTML

<a href="http://fiddle.jshell.net">jsfiddle</a><br>
<a href="http://www.google.com">google</a>

JavaScript

$("a[href^=http]").click(function(){
          if(this.href.indexOf(location.hostname) == -1) {
             $(this).attr({
                target: "_blank",
                title: "Opens in a new window"
             });
          }
       })