JSFiddle - React, Tailwind, and code Playground

HTML

<div id="links">
  <a href="http://www.google.es">Href</a><br>
  <a href="javascript:void(0)" onclick="$('#paypal_payment_form').submit();">OnClick</a>
</div>

<div id="console"></div>

JavaScript

allowPaymentSubmit = false;

$(document).on('click', '#links a', function(event){
	
  $('#console').append('clicked<br>');
  var el = $(this);
  
	if(!allowPaymentSubmit) {
		event.preventDefault();
    
		//My Ajax call logic
    //On ajax success set to true and trigger click
		allowPaymentSubmit = true;
		el.trigger('click');
	}
  
});