title: Open tab in next window with javascript document.addEventListener
body: <p>i am using this script to open a file on click having id link,I can figure out the way to open the file in next tab on click,Thanks in advance</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
  document.addEventListener( 'wpcf7mailsent', function( event ) {
   location = document.getElementById("link").getAttribute("href");
  }, false );
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>