-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTML_1.html
More file actions
43 lines (36 loc) · 1.77 KB
/
HTML_1.html
File metadata and controls
43 lines (36 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<title>HTML_1</title>
<meta charset="utf-8">
</head>
<body>
<!-- Write out a switch statement, a switch statement performs different actions based on the conditions presented to it -->
<h1>What is your favorite animal?</h1>
<h3>Pick your favorite animal from the list below:</h3>
<ul>
<li>Cat</li>
<li>Dog</li>
<li>Fish</li>
<li>Hamster</li>
<li>Snake</li>
<li>Lizard</li>
</ul>
<h3>Enter your choice below:</h3>
<input id="Animal_Input" type="text">
<button onclick="Animal_Function()">Submit animal choice</button>
<p id="Output"></p>
<!-- End of switch statement code -->
<!--Utilize the document.getElementsByClassName() method, returns a collection of elements with a specified class name(s) -->
<p>Example of using the "document.getElementsByClassName() method" below:</p>
<div class="example">This is the first string with the class designated "example"</div>
<div class="example">This is the second string with the class designated "example"</div>
<div class="example">This is the third string but the first string should read differently than line #2 and this line</div>
<!-- Utilize the <canvas> element and add a border to the canvas -->
<canvas id="canvas_Example" width="400" height="200" style="border:2px solid #DC143C;"></canvas>
<!-- Utilize the <canvas> element with createLinearGradient() method -->
<canvas id="canvas_Example2" width="400" height="200" style="border:2px solid #000000;"></canvas>
<script src="JavaScript/JavaScript_1.js"></script>
</body>
</html>