Lab15
This commit is contained in:
		
							
								
								
									
										23
									
								
								Chapter ZIPs/JavaScript/ch7/ex_7_1.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								Chapter ZIPs/JavaScript/ch7/ex_7_1.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>Example 7.1</title>
 | 
			
		||||
<script>
 | 
			
		||||
function quotient(x,y)
 | 
			
		||||
{
 | 
			
		||||
	illegal = "Illegal division operation";
 | 
			
		||||
	if (y != 0)
 | 
			
		||||
		return x/y;
 | 
			
		||||
	else
 | 
			
		||||
		return illegal;
 | 
			
		||||
}
 | 
			
		||||
function clickIt()
 | 
			
		||||
{
 | 
			
		||||
	document.write(quotient(60, 5));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<input type ="button" onclick="clickIt()" value = "How much is 60 divided by 5?"></button>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user