It is super easy.
You need to remove the attribute onclickfrom the tag input.
Then enter your code to open a new tab using JS after the line alert.
<form><input type="button" id="anchor1" style="padding:5px; cursor:pointer" value="Click Here"></form>
JS- :
var anchor = document.getElementById('anchor1');
anchor.addEventListener('click', doSomething, false);
function doSomething() {
alert('You Are About To Open New Tab');
var win = window.open("http://google.com", '_blank');
win.focus();
}
Fiddle