-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (74 loc) · 3.28 KB
/
index.html
File metadata and controls
82 lines (74 loc) · 3.28 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!doctype html>
<html lang="en" class="h-100">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>JS Challenge 01</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.2/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://use.typekit.net/lxy8kpx.css">
<link href="/css/site.css" rel="stylesheet">
<link href="/Challenge01/site01.css" rel="stylesheet">
</head>
<body class="h-100">
<nav class="navbar navbar-expand-xl navbar-dark fixed-top bg-dark" id="navmenu">
</nav>
<main class="container-fluid h-100 px-5">
<div class="row">
<div class="col-12 col-md-6">
<h1>Longest String in an Array</h1>
<p class="lead">Given an array of marvel heroes, write a function that accepts the array of names (strings).
<br> The function should return the hero with the longest name. <br> The user should click the
button to display the heroes name below.</p>
<p><h3>List of Heroes</h3>
<code>
[
"Ant-Man",
"Black Panther",
"Black Widow",
"Captain America",
"Doctor Strange",
"Hawkeye",
"Hulk",
"Iron Man",
"Luke Cage",
"Moon Knight",
"Ms. Marvel",
"Scarlet Witch",
"Spider-Man",
"Thor",
"Wasp"
]
</code></p>
<p><strong>Extra Credit:</strong><em> Find an attractive way to display the entire list of names below
the longest name.</em></p>
<button id="btnSubmit" type="button" class="btn btn-warning">Display Hero</button>
</div>
<div class="col-12 col-md-6 order-first order-md-2">
<img src="/img/JSChallenge.png" class="img-fluid" alt="js Challengeimage">
</div>
<div class="col-12 order-last mt-4 mb-2">
<div id="results" class="heroName display-6">
Heroes Name Goes Here
</div>
<div id="namelist">
</div>
</div>
</div>
</main>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous">
</script>
<script src="/Challenge01/site01.js"></script>
<script>
document.getElementById("btnSubmit").addEventListener("click", findHero);
</script>
<script src="/js/menu.js"></script>
<script>
window.addEventListener("load", getmenu(1));
</script>
</body>
</html>