$("body").on('click', 'a', function(e){ e.preventDefault() const url = e.target.getAttribute("href"); window.open(url, '_blank').focus() })