JSFiddle - React, Tailwind, and code Playground

by jashwant

HTML

<form id='myform' action=''>
</form>
<a href="javascript:submit()">submit</a>

JavaScript

function submit() {
   alert('bye'); 
}
jQuery(function() {
    $('a').each(function() {
        var $this = $(this);
        var href = $this.attr('href');
        $this.attr('href','javacript:void(0);');
        $this.data('href',href);
    }).click(function() {
        var href = $(this).data('href').replace('javascript:','');
        console.log(href); 
        alert('hi');
        eval(href);        
    });
});