ASDV-WebDev/Semester 1/Chapter ZIPs/JavaScript/ch7/ex_7_1.html

24 lines
359 B
HTML

<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>