Skip to content

Commit 32accab

Browse files
Add files via upload
1 parent d9ac7b2 commit 32accab

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>Document</title>
8+
9+
<style>
10+
p {
11+
font-family: 'helvetica neue', helvetica, sans-serif;
12+
letter-spacing: 1px;
13+
text-transform: uppercase;
14+
text-align: center;
15+
border: 2px solid rgba(0,0,200,0.6);
16+
background: rgba(0,0,200,0.3);
17+
color: rgba(0,0,200,0.6);
18+
box-shadow: 1px 1px 2px rgba(0,0,200,0.4);
19+
border-radius: 10px;
20+
padding: 3px 10px;
21+
display: inline-block;
22+
cursor: pointer;
23+
}
24+
</style>
25+
</head>
26+
<body>
27+
<p>Player 1: Chris</p>
28+
29+
<script>
30+
//Prompt and update text content
31+
32+
const para = document.querySelector('p');
33+
para.addEventListener('click', updateName);
34+
35+
function updateName() {
36+
let name = prompt('Enter a new player');
37+
para.textContent = 'Player 1: ' + name;
38+
}
39+
</script>
40+
</body>
41+
</html>

0 commit comments

Comments
 (0)