Page 320 - Web Applications (803) Class 11
P. 320
Example:
<HTML>
<BODY>
<SCRIPT>
var num1=prompt("Enter first number");
var num2=prompt("Enter second number");
document.write("Numbers entered :"+num1+","+num2);
document.write("<BR> <BR>");
if (num1!=num2) {
document.write("Numbers are not equal");}
else if(num1>num2) {
document.write(num1+" is greater than "+num2);}
else if(num2>num1) {
document.write(num2+" is greater than "+num2);}
else {
document.write("Both numbers are equal");}
</SCRIPT>
</BODY>
</HTML>
Output:
When you click on the “OK” button, with the message “this page says”. Then a new window appears as” Enter second
number”
318 Touchpad Web Applications-XI

