JSFiddle - React, Tailwind, and code Playground
by medmunds
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<a class="offsite" href="http://www.example.com/?1">
Offsite link 1</a>
<a class="offsite" href="http://www.example.com/?2">
Offsite link 2</a>
<div id="log"></div>
</body>
</html>
JavaScript
$(document).delegate('a.offsite', 'click', function(e) {
var $this = $(this),
href = $this.attr('href');
e.preventDefault();
window.open(href + "?test", "_blank");
});
$(document).delegate('a[href^="http"]', 'click', function(event) {
var href = $(this).attr('href');
$('#log').text("Clicked " + href);
});