HTML Form with `target='_blank'` Not Opening in New Tab on Submit - Need guide Debugging
I've been researching this but I'm stuck on something that should probably be simple. I'm having trouble with an HTML form where I expect the submission to open in a new tab due to the `target='_blank'` attribute. However, upon submission, it just reloads the current page instead of opening a new one. Here's a simplified version of my form: ```html <form action='https://example.com/submit' method='post' target='_blank'> <input type='text' name='username' required /> <input type='password' name='password' required /> <button type='submit'>Submit</button> </form> ``` I've tried testing this in both Chrome and Firefox, and both behave the same way. I also double-checked that pop-ups are allowed for the site, as I've read that can sometimes interfere with new tabs. I've seen some discussions suggesting that modern browsers may restrict the `target='_blank'` functionality under certain circumstances, especially with forms, but Iām not sure what would trigger that. Additionally, I tried adding an `onsubmit` handler to log the form data and confirm that the form is processed correctly: ```javascript document.querySelector('form').onsubmit = function(event) { console.log('Form submitted:', this); }; ``` The log shows that the form is indeed submitted, but it still results in a page refresh instead of opening a new tab. Is there a specific way to ensure the form submission respects the `target` attribute, or am I missing a crucial detail? Any insights or workarounds would be greatly appreciated! What would be the recommended way to handle this?