Following js code refreshing the page to the url, but i wanna make it open in a new tab.
case"example1": case"example2":
l.after('<meta http-equiv="refresh" content="0; url=https://example.com" /> Opening...'); ```
Can anyone help me about that?
Steps for opening a link in a new tab:
a element"https://example.com" )target to "_blank"Code:
<button onclick="myFunction()">Open</button>
<script>
function myFunction() {
link = document.createElement("a")
link.href = "https://example.com"
link.target = "_blank"
link.click()
}
</script>