Semester 3 pog
This commit is contained in:
28
Semester 1/Assignments/JavaScript/ch03/ex_3_2.html
Executable file
28
Semester 1/Assignments/JavaScript/ch03/ex_3_2.html
Executable file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 3.2</title>
|
||||
<script>
|
||||
function getTemp()
|
||||
{
|
||||
var temp = prompt("What's the temperature today?","degrees Fahrenheit");
|
||||
if (temp < 32)
|
||||
{
|
||||
document.write("<p>It may snow today!</p>");
|
||||
document.write("<p>Be sure to wear your boots and mittens.</p>");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.write("<p>It's too warm to snow today.</p>");
|
||||
document.write("<p>Boots are optional.</p>");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</<head>
|
||||
<body>
|
||||
<h1>What's the Weather?</h1>
|
||||
<h3>Click the button! </h3>
|
||||
<p><input type="button" id="temperature" value="What is today's temperature?" onclick="getTemp();" /></p>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user