I was testing the following code:

<form id="test" action="mypage.php" method="post" target="_blank">
<input type="hidden" value="hello" name="myvar">
</form>

Just before the </form>, if i add <input type="submit">, mypage.php opens normally in a new tab. Instead of the submit button, if i do it using js document.getElementById('test').submit(), mypage.php opens in a new window and not in a new tab. Why is that happening? Can i make .submit() open the page in a new tab?