I want to execute a href without redirecting me to the page. execution in background. here is my code
<a id="speechOutputLink" href="http://translate.google.com/translate_tts?tl=fr&q=text" rel="noreferrer" >Download</a>
When i click on the the href Download i don't want to be redirected to the page of google translator. How can i do this?
Use jQuery's event.preventDefault() method:
If this method is called, the default action of the event will not be triggered.
$('a#speechOutputLink').on('click', function(e) {
e.preventDefault();
...
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With