forked from StephenMayeux/bootstrap_tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
35 lines (26 loc) · 913 Bytes
/
script.js
File metadata and controls
35 lines (26 loc) · 913 Bytes
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
$(document).ready(function() {
var koreanCities = ["Busan", "Seoul", "Masan", "Daegu", "Gimhae", "Ulsan", "Jejudo"];
var myLoveProfile = {
name: "Stephen",
single: false,
age: 29,
currentCity: koreanCities[0]
};
var possibleMatch= {
name: "Ji-yeon",
single: true,
age: 23,
currentCity: koreanCities[0]
};
$('#loveButton').on('click', function() {
if (myLoveProfile.currentCity === possibleMatch.currentCity && myLoveProfile.single && possibleMatch.single) {
$('h1').('You are a match!');
} else if (myLoveProfile.currentCity !== possibleMatch.currentCity && myLoveProfile.single && possibleMatch.single) {
$('h1').text('Do you like long distance?');
} else if (!myLoveProfile.single && myLoveProfile.currentCity !== possibleMatch.currentCity) {
$('h1').text('You are a cheater!!');
} else {
$('.message').append('<h1 style="color: red">You are not a match</h1>');
}
});
});