Timing code-
<input type="button" value="Click" onclick="setTimeout(hello, 5000)">
<script>
function hello(){
// alert("yes you can go anywhere!!");
window.location='https://www.google.com/';
}
</script>
Confirm popup code-
<input type="button" value="Click to Know" onclick="hello()">
<p id="show"></p>
<script>
function hello(){
var result;
if(confirm("Yes tell me what you want to do?"))
{
result = "You press OK!!!";
}
else{
result = "You press Cancel!!!!!!!!";
}
document.getElementById("show").innerHTML=result;
}
</script>