Prompt box, alert box and confirm box in JS(using Switch Case)


This Code basically shows the usage of alert box, prompt box and confirm box in javascript


<!DOCTYPE html>
<html>
<head>
	<title>JAVASCRIPT</title>
	<script type="text/javascript">

	function multiply(x,y,z)
	{
		var mul=x*y*z;
		return mul;
	}

 var a=prompt("Enter the value of A");
 var b=prompt("Enter the value of B");
 var c=prompt("Enter the value of c");

var ans=confirm("Do You want to see the Multiplication of these three elements");
if(ans==true)
document.write("After Multiplication of these three variables we get" +
 multiply(a,b,c));
 else {
 	alert("GO Away!!");
 }

	</script>
</head>
<body >
<h1>USE OF SWITCH, ALERT,CONFIRM AND PROMT IN JAVASCRIPT</h1>
</body>
</html>

Comments

Popular posts from this blog