Search code examples
htmltagsanchor

Get anchor tag to open in new window


Is there a way to get anchor tags to open in a new window instead of the current one?

    <a href="my_link">Link</a>

Solution

  • Use jQuery/javascript to open in new window

    $('a').click(function(){ 
      window.open('http://google.com') 
    });