forked from objcode/Hack-the-Future
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3 prompt.html
48 lines (46 loc) · 1.07 KB
/
3 prompt.html
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
<html>
<head>
<script language="javascript"
src="http://code.jquery.com/jquery-1.6.js">
</script>
<title>Pong</title>
</head>
<body>
<!-- Do not edit this -->
<div id="gameinfo">
<span id="player1-info">
<span id="player1-name" class="name">
Player 1
</span>
<span id="player1-score">
0
</span>
</span>
<span id="player2-info">
<span id="player2-name" class="name">
Player 2
</span>
<span id="player2-score">
0
</span>
</span>
</div>
<hr>
<div id="gamearea">
<!-- left blank -->
</div>
<!-- Put your code inside this script tag -->
<script type="text/javascript">
// Demonstrate CLASS and ID lookup
$(".name").after(':')
$("#gameinfo").css('width', '500px');
$("#player2-info").css('float', 'right');
//Show how to do prompt stuff
// this is the FIRST time they'll have seen variables
input = prompt("What is player 1's name?");
$("#player1-name").html(input);
input = prompt("What is player 2's name?");
$("#player2-name").html(input);
</script>
</body>
</html>