JSFiddle - React, Tailwind, and code Playground
by jessekinsman
HTML
<a href="#" id="mailto">Contact Us</a>
<a href="mailto:[email protected]" id="mailto">Contact 2</a>
JavaScript
$("#mailto").click(function(e){
var target = $(e.target);
if (target.attr("href") === "#") {
console.log(e.currentTarget);
target.attr("href", "mailto:[email protected]");
//e.currentTarget.click();
}
});