-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhileJquery.html
More file actions
57 lines (42 loc) · 1.24 KB
/
whileJquery.html
File metadata and controls
57 lines (42 loc) · 1.24 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bucket List</title>
<script src="https://code.jquery.com/jquery-2.1.1.js"></script>
</head>
<body>
<h1>BUCKET LIST</h1>
<div id="bucket"></div>
<h1>PERFECT MARGARITA</h1>
<div id="recipe"></div>
<script>
var bucket_list = [];
var i = 0;
bucket_list[0] = "Visit Japan";
bucket_list[1] = "Sleeper car trip through Italy";
bucket_list.push("Open a boutique with my sister", "Build a workshop");
bucket_list.unshift("Become a kick-butt web developer", "Open decorator business");
var dying_wish = bucket_list.pop();
var do_it_now = bucket_list.shift();
var recipe= [];
recipe [0]= "Add";
recipe [1]= "1 oz. tequila";
recipe [2]= "1/2 oz. triple sec";
recipe [3]= "1 oz. lime juice";
recipe [4]= "simple syrup to the glass";
recipe [5]= "Rub lime on the rim of the glass";
recipe [6]= "Rub the rim of glass in salt";
recipe [7]= "Add a few ice cubes and drink up!";
function append_strings(array, target_div) {
var i=0;
while (i < array.length) {
$(target_div).append('<p>' + array[i] + '</p>');
i++
}
}
append_strings(bucket_list, '#bucket');
append_strings(recipe, '#recipe');
</script>
</body>
</html>