The JavaScript checked property is easy ✅

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 19

  • @BroCodez
    @BroCodez  Рік тому +8

    // .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 11 місяців тому

      epic

    • @studyplant5715
      @studyplant5715 10 місяців тому

      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 3 місяці тому +1

      Thanks a lot sir🥰

  •  10 місяців тому +15

    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 3 місяці тому +1

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

  • @christophertucciarone8317
    @christophertucciarone8317 8 днів тому

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

  • @helioobianchi
    @helioobianchi 7 місяців тому +3

    Thanks, bro. You're a real bro 💪

  • @rajushah8748
    @rajushah8748 4 місяці тому +2

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

  • @piotrmazgaj
    @piotrmazgaj 2 місяці тому +1

    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.

  • @mrgames-Will
    @mrgames-Will 11 місяців тому +2

    Thanks as always ❤

  • @spacejosh882
    @spacejosh882 11 місяців тому +1

    Really cool tutorial, thanks!

  • @MajesticaYEH
    @MajesticaYEH 5 місяців тому +1

    This is exactly the way I can understand js.

  • @gullapallijyothikiran3371
    @gullapallijyothikiran3371 11 місяців тому +1

    do videos for the select dropdown .

  • @peschkeraphel
    @peschkeraphel 11 місяців тому

    you're doing good videos I like it

  • @יצחקגבאי-ט6ד
    @יצחקגבאי-ט6ד 4 місяці тому

    You are the best

  • @MrPvssy
    @MrPvssy Рік тому

    Daddy Brocode teaches me lots

  • @dinesh2076
    @dinesh2076 8 місяців тому +1

    onlick😂😂🤣🤣

  • @alan-overthenet
    @alan-overthenet Місяць тому

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