JSFiddle - React, Tailwind, and code Playground

by Hristiyan Dodov

HTML

<a id="mytest" href="https://twitter.com/" target="_blank">Test link</a>

JavaScript

var link = document.getElementById("mytest");
link.addEventListener("click", function (e) {
	// Add script to display the modal here.
    // When scroll-clicking, this won't be emitted => won't open the modal.
    // However, it would still open the link in a new tab.
    // Check the console for proof?
	console.log("clicked");
    e.preventDefault();
});