title: Redirect with new tab in javascript
body: <p>I did a new tab function if I click a submit button using java script. The problem is the location of the parent page, if I click submit button there's a new tab but if I insert a code of location changing it doesn't work . Please help me. </p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
   $("form").submit(function() {
       $("form").attr('target', '_blank');
       return true;
   });
   &lt;/script&gt;
  
  &lt;form action="test.php" method="POST" target="_blank"&gt;
      &lt;input type="submit" name="submit" value="Submit" onclick="document.location.href='home.php';"/&gt;
  &lt;/form&gt;
  </code></pre>