document.getElementById("myButton").onclick = function () { if (document.getElementById("myCheckBox").checked) { console.log("Channel subscribed"); } else { console.log("Check the checkbox to subscribe"); } } const visaButton = document.getElementById("visa"); const paypalButton = document.getElementById("paypal"); const masterButton = document.getElementById("master"); document.getElementById("payButton").onclick = function () { if (visaButton.checked) { console.log("Proceding to checkout with visa"); } else if (paypalButton.checked) { console.log("Proceding to checkout with paypal"); } else if (masterButton.checked) { console.log("Proceding to checkout with master"); } else { console.log("You must select a payment-type"); } }