I'm currently using the below to add a user's input to a URL but it opens in the same window. I've tried window.open to get the link to open in a new tab with no luck. I've also tried adding _blank but it appends that to the URL.
<form onsubmit="window.location = 'https://demosite.com/' + input1.value; return false;">
<input id="input1" placeholder="Placeholder" name="input1"/>
<input type="submit" value="Send"/>
</form>
You can use window.open fucntion with target as '_blank'.
try this code
more further you can refer this link https://developer.mozilla.org/en-US/docs/Web/API/Window/open
Thanks