SyntaxFix
Write A Post
Hire A Developer
Questions
try this one, which simulates a click on an anchor.
var a = document.createElement('a'); a.href='http://www.google.com'; a.target = '_blank'; document.body.appendChild(a); a.click();