How to redirect to new page using javascript

How can I redirect the whatsapp api link in new page? When I press ok the whatsapp api is open in same page.

The code I have tried so far.

   setTimeout(function () {
      applause.play();
      swal(
        "Congratulations",
        "" + SelectedItem + ".",
        "success"
      ).then(function() {
            window.location.replace("https://api.whatsapp.com/send?phone=+91123456789" );
            });
    }, 5500);

>Solution :

window.open("https://api.whatsapp.com/send?phone=+91123456789", '_blank');

Leave a Reply