'How do I get this button to popup the link?

When I click this button it loads the page onto my previous page. What can I do to make it popup on a new page or tab?

<button class="btn btn-primary" style="width:100%;height:100%;" onclick= "location.href='LINKLINKLINKLINK'">Verify</button>

Thanks in advance



Solution 1:[1]

You can use window.open to open the required page as a popup. Try this:

<button class="btn btn-primary" style="width:100%;height:100%;" onclick= "window.open('LINKLINKLINKLINK')">Verify</button>

Solution 2:[2]

Window.open is more accurate for your use. You could also add the target attribute to your link so it will open a new tab or window :

window.open("yourlink", "_blank");

Solution 3:[3]

You can use the target attribute it helps you open it in new page or this page and many more the below code can help.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Open Link In New Tab</title>
</head>
<body>
  <h1><a href="https://www.google.com/" target="_blank">Google in New Tab</a></h1>
</body>
</html>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nisarg Shah
Solution 2 rabsom
Solution 3 Evil-Coder