00:00:00 intro
00:00:22 HTML checkbox
00:01:13 HTML radiobuttons
00:02:58 other HTML elements
00:03:55 CSS
00:04:39 JavaScript constants
00:06:08 .onclick property
00:06:31 .checked property
00:09:49 conclusion
// .checked = property that determines the checked state of an
// HTML checkbox or radio button element
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 if(payPalBtn.checked){
paymentResult.textContent = `You are paying with PayPal`;
}
else{
paymentResult.textContent = `You must select a payment type`;
}
}
On this page of the site you can watch the video online The JavaScript checked property ( javascript tutorial 12 ) with a duration of hours minute second in good quality, which was uploaded by the user Raya yt 01 January 1970, share the link with friends and acquaintances, this video has already been watched 19 times on youtube and it was liked by 3 viewers. Enjoy your viewing!