Lab15
This commit is contained in:
		
							
								
								
									
										21
									
								
								Chapter ZIPs/JavaScript/ch7/ex_7_15.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								Chapter ZIPs/JavaScript/ch7/ex_7_15.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>Example 7.15</title>
 | 
			
		||||
<script type="text/javascript" src="mySource.js"></script>
 | 
			
		||||
<script>
 | 
			
		||||
function shipIt()
 | 
			
		||||
{
 | 
			
		||||
	var shipCode = "FREEBIE";
 | 
			
		||||
	var userCode = prompt("Enter your code:");
 | 
			
		||||
	if (checkWord(shipCode, userCode))
 | 
			
		||||
		document.getElementById('result').innerHTML = ("Shipping is free!");
 | 
			
		||||
	else
 | 
			
		||||
		document.getElementById('result').innerHTML = ("Sorry, your code is not valid");
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
</head>
 | 
			
		||||
<body><table align="center" width = "70%"><tr><td><br />
 | 
			
		||||
<input type ="button" onclick="shipIt()" value = "Enter free shipping code"><br />
 | 
			
		||||
<h3><span id = "result"> </span></h3>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user