The JavaScript checked property is easy ✅

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 25

  • @BroCodez
    @BroCodez  Год назад +12

    // .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
      @masternobody1896 Год назад

      epic

    • @studyplant5715
      @studyplant5715 Год назад

      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
      @SourovChandraBarmon 6 месяцев назад +1

      Thanks a lot sir🥰

  •  Год назад +20

    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
      @nemesis_rc 6 месяцев назад +1

      Exactly, the small handson are very useful for learning the difficult concepts

  • @thenoobwhogrinds
    @thenoobwhogrinds 2 месяца назад +3

    Thanks for making this series. Without you I would've never successed!
    This video was the most useful, that's why I'm commenting on this one lol.

  • @piotrmazgaj
    @piotrmazgaj 5 месяцев назад +3

    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
    @rajushah8748 7 месяцев назад +3

    You are a real Bro to us . We love you 😘

  • @helioobianchi
    @helioobianchi 10 месяцев назад +4

    Thanks, bro. You're a real bro 💪

  • @christophertucciarone8317
    @christophertucciarone8317 3 месяца назад

    Incredible - I'm going through each video. thank you so much.

  • @MajesticaYEH
    @MajesticaYEH 8 месяцев назад +3

    This is exactly the way I can understand js.

  • @kavitha-99
    @kavitha-99 26 дней назад

    Super 👏👏👏

  • @mrgames-Will
    @mrgames-Will Год назад +2

    Thanks as always ❤

  • @spacejosh882
    @spacejosh882 Год назад +1

    Really cool tutorial, thanks!

  • @furqan-xyz
    @furqan-xyz Месяц назад

    "All the heros don't wears cap ,
    some also teach coding."

  • @gullapallijyothikiran3371
    @gullapallijyothikiran3371 Год назад +1

    do videos for the select dropdown .

  • @peschkeraphel
    @peschkeraphel Год назад

    you're doing good videos I like it

  • @MrPvssy
    @MrPvssy Год назад

    Daddy Brocode teaches me lots

  • @mantaskarpas4043
    @mantaskarpas4043 Месяц назад

    what is in the last code on the PayPal in JavaScript the wont show as you are paying with PayPal i do have the whole code typed up right but the last bit does not want to work

  • @יצחקגבאי-ט6ד
    @יצחקגבאי-ט6ד 7 месяцев назад

    You are the best

  • @dinesh2076
    @dinesh2076 11 месяцев назад +1

    onlick😂😂🤣🤣

  • @v9wyd
    @v9wyd 2 месяца назад

    * this works *

    • @mansoorahmad-s1n
      @mansoorahmad-s1n Месяц назад

      of course it works this is bro code not someone else

  • @alan-overthenet
    @alan-overthenet 4 месяца назад +1

    Magic!
    Clear radio buttons on page refresh:
    window.onload = function () {
    let radios = document.getElementsByName('card');
    radios.forEach(function (radio) {
    radio.checked = false;
    });
    };