-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
27 lines (22 loc) · 856 Bytes
/
index.js
File metadata and controls
27 lines (22 loc) · 856 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
const myCheckBox = document.getElementById("myCheckBox");
const visaBtn = document.getElementById("visaBtn");
const masterCardBtn = document.getElementById("masterCardBtn");
const payPalBtn = document.getElementById("payPalBtn");
const mySubmit = document.getElementById("mySubmit");
const subResult = document.getElementById("subResult");
const paymentResult = document.getElementById("paymentResult");
mySubmit.onclick = function () {
if(myCheckBox.checked) {
subResult.textContent = `You are subscribed!`
}else{
subResult.textContent = `You are not subscribed!`
}
if(visaBtn.checked){
paymentResult.textContent = `You are paying with Visa`
}
else if (masterCardBtn.checked){
paymentResult.textContent = `You are paying with MasterCard`
}else {
paymentResult.textContent = `You are paying with PayPal`
}
}