Jelly Jelly - 2 years ago 85
HTML Question

How to make a link open in new tab as well as redirect in current

So, I need to make it so if the user is on and they click something, then in the tab, they are redirected to AND a link is opened in a new tab. I tried this:

<a href="dog.html" target="_self" onclick="'cat.html');">Click</a>
which kind of worked, but it would like... make it all weird

Answer Source

<a href="#" target="_self" onclick="RedirectUrl()">Click</a> 
    function RedirectUrl(){    
       window.location.href ="yourUrl";

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download