I have a folder that contains two aspx empty website files (task1.aspx , task2.aspx). That's the code that I have in task1.aspx :
<html>
<head>
<title>TASK 1</title>
</head>
<body>
<p id="answer" style="font-size: 89px"></p>
<script type="text/javascript">
num1 = parseInt(prompt("Please enter num1:"));
num2 = parseInt(prompt("Please enter num2:"));
if (num1 > num2) {
var ans = num1;
document.getElementById("answer").innerHTML = "The biggest number is num1 and is equal to " + ans;
}
else if (num2 > num1) {
var ans = num2;
document.getElementById("answer").innerHTML = "The biggest number is num2 and is equal to " + ans;
}
</script>
</body>
</html>
Pretty simple JS code... I just wanted to know if it's possible to open the second aspx file (task2.aspx) right after the JavaScript code of task1 ends so it will open taks2 page in a new, blank page? Can U help me?
I tried some of the answers here but I actually wanted the new page to be opened in a new tab. Do you know how to do it?