-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
20 lines (16 loc) · 736 Bytes
/
script.js
File metadata and controls
20 lines (16 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var result = document.querySelector("#result");
var parameters = new URLSearchParams(window.location.search);
var inputName = parameters.get('name');
var inputEmail = parameters.get('email');
var inputTime = parameters.get('time');
var inputPersons = parameters.get('persons');
var inputFamily = parameters.get('family');
var inputLocation = parameters.get('location');
var inputDiets = parameters.get('diets');
result.innerHTML = 'Welcome ' + inputName + '! The ' + inputLocation + ' is confirmed for you.';
//change background color green if all the persons come from the same family otherwise red
if (inputFamily == 'on') {
document.body.style.backgroundColor = 'green';
} else {
document.body.style.backgroundColor = 'red';
}