// .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`; } } My website subscribe Visa MasterCard PayPal submit body{ font-family: Verdana; font-size: 2em; } #mySubmit{ font-size: 1em; }
@masternobody1896
10 ай бұрын
epic
@studyplant5715
9 ай бұрын
why we are write first in const the id onst 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"); that values ?? what is reason for write this @@masternobody1896
@SourovChandraBarmon
Ай бұрын
Thanks a lot sir🥰
9 ай бұрын
Bro, this new JS series is just great because it is full of examples and mini project in which we can apply the knowledge to a real situation. Thanks a bunch!
@nemesis_rc
2 ай бұрын
Exactly, the small handson are very useful for learning the difficult concepts
@piotrmazgaj
Ай бұрын
This is my seal. I have watched the entire video, understood it, and I can explain it in my own words, thus I have gained knowledge. This is my seal.
@rajushah8748
2 ай бұрын
You are a real Bro to us . We love you 😘
@helioobianchi
5 ай бұрын
Thanks, bro. You're a real bro 💪
@mrgames-Will
10 ай бұрын
Thanks as always ❤
@spacejosh882
10 ай бұрын
Really cool tutorial, thanks!
@sayehghaderi9455
4 ай бұрын
This is exactly the way I can understand js.
@gullapallijyothikiran3371
9 ай бұрын
do videos for the select dropdown .
@MrPvssy
10 ай бұрын
Daddy Brocode teaches me lots
@peschkeraphel
10 ай бұрын
you're doing good videos I like it
@user-xu4bt2bq4g
3 ай бұрын
You are the best
@dinesh2076
7 ай бұрын
onlick😂😂🤣🤣
@alan-overthenet
14 күн бұрын
Magic! Clear radio buttons on page refresh: window.onload = function () { let radios = document.getElementsByName('card'); radios.forEach(function (radio) { radio.checked = false; }); };
Пікірлер: 18