JavaScript COUNTER PROGRAM 🔢

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 67

  • @BroCodez
    @BroCodez  ปีที่แล้ว +17

    // COUNTER PROGRAM
    const increaseBtn = document.getElementById("increaseBtn");
    const decreaseBtn = document.getElementById("decreaseBtn");
    const resetBtn = document.getElementById("resetBtn");
    const countLabel = document.getElementById("countLabel");
    let count = 0;
    increaseBtn.onclick = function(){
    count++;
    countLabel.textContent = count;
    }
    decreaseBtn.onclick = function(){
    count--;
    countLabel.textContent = count;
    }
    resetBtn.onclick = function(){
    count = 0;
    countLabel.textContent = count;
    }


    My website

    0

    decrease
    reset
    increase


    #countLabel{
    display: block;
    text-align: center;
    font-size: 10em;
    font-family: Helvetica;
    }
    #btnContainer{
    text-align: center;
    }
    .buttons{
    padding: 10px 20px;
    font-size: 1.5em;
    color: white;
    background-color: hsl(214, 100%, 74%);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.25s;
    }
    .buttons:hover{
    background-color: hsl(214, 100%, 56%)
    }

    • @EllisKankam
      @EllisKankam ปีที่แล้ว +1

      Bro code please we need django course

    • @SourovChandraBarmon
      @SourovChandraBarmon 6 หลายเดือนก่อน

      Thanks a lot sir🥰

  • @l-fitness3590
    @l-fitness3590 ปีที่แล้ว +10

    After you showing the increase it was straight forward after that great video and fun little project

    • @l-fitness3590
      @l-fitness3590 ปีที่แล้ว +2

      1st day of learning javascript I managed to take this and make it so you get a point every time you hit a number which will give you a point using if statements

  • @piotrmazgaj
    @piotrmazgaj 5 หลายเดือนก่อน +6

    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.

  • @rayyan-n9k
    @rayyan-n9k ปีที่แล้ว +4

    bro thanks for your video not only I learned javascript but also css
    keep up the good work

  • @mr.kachoo8784
    @mr.kachoo8784 ปีที่แล้ว +3

    I really enjoyed this, thanks for sharing!

  • @pablosantos-bk4hy
    @pablosantos-bk4hy 8 หลายเดือนก่อน +2

    eu fiquei muito feliz, tentei fazer o reset sozinho, botei lá count = 0 e deu certo, foi o mesmo jeito que vc fez! ok i Will try in english ------- I am very happy because I try to do the reset part alone, and I put count = 0 and the result was the same of you!

  • @peaklegacy146
    @peaklegacy146 ปีที่แล้ว +19

    So sad that onLick doesn't work😭😛

    • @Jayeffice
      @Jayeffice ปีที่แล้ว +2

      I watch for the HUMOR first and the coding second..!
      so glad he didn't disappoint :)

  • @nevouxjulie6595
    @nevouxjulie6595 10 หลายเดือนก่อน

    Thank you, they aren't enough videos of people demonstrating !!

  • @nikakuprashvili8235
    @nikakuprashvili8235 ปีที่แล้ว +1

    Thank you very much bro and good luck in this good work, you explain the best and most clearly on all TH-cam👌👋❤

  • @folgediewahrheit2827
    @folgediewahrheit2827 ปีที่แล้ว +1

    That was very good, thank you very much. i like how you explain too.

  • @stadx
    @stadx ปีที่แล้ว +2

    Hey bro, do you plan to bring a beginner's TypeScript playlist? Cheers.

  • @Jayeffice
    @Jayeffice ปีที่แล้ว +1

    Without the humor, dry mono tone oration , and I don't give crap about being politically correct, these are just another coding tut. Love em you never disappoint OnLick :0
    It's as if Jamie King's Voice got three octaves higher, added some humor, and spoke at a better cadence.
    No slam loved him when he was still posting vids.

  • @jagdishjena9058
    @jagdishjena9058 4 หลายเดือนก่อน

    Superb explanation sir.. Love the way you teach in a simple manner

  • @helioobianchi
    @helioobianchi 10 หลายเดือนก่อน

    Thanks, bro. You're a real bro 💪

  • @Qtaro-oh
    @Qtaro-oh ปีที่แล้ว +6

    how to recreate NASA database from scratch next ples

    • @Hnxzxvr
      @Hnxzxvr หลายเดือนก่อน +2

      I’m done :)

    • @Qtaro-oh
      @Qtaro-oh หลายเดือนก่อน +1

      @@Hnxzxvrdone with what

    • @Hnxzxvr
      @Hnxzxvr หลายเดือนก่อน +2

      @ making the NASA db

    • @Qtaro-oh
      @Qtaro-oh หลายเดือนก่อน

      @@Hnxzxvr send ples

  • @codewhiz2.0
    @codewhiz2.0 ปีที่แล้ว +2

    i like how you explain those things bro code

  • @nikakuprashvili8235
    @nikakuprashvili8235 ปีที่แล้ว +2

    next can you explain how to build windows form application with C# for begginers please

  • @kaveenpspoorna7379
    @kaveenpspoorna7379 5 หลายเดือนก่อน

    Thankyou so much sir😊

  • @medad1877
    @medad1877 ปีที่แล้ว +3

    you're the best.
    let me know now I understand everything but still my problem I can't build the project alone just from ideas using Html &CSS even will I finish JS too, How can I will be the good programmer :( ?

  • @johnzgallerie2827
    @johnzgallerie2827 6 วันที่ผ่านมา

    @BroCodez ur the man - OMG... how cool is this!!!

  • @viniciusm.m.7822
    @viniciusm.m.7822 15 วันที่ผ่านมา

    THANKS!

  • @badreddineelkalai9052
    @badreddineelkalai9052 10 หลายเดือนก่อน +1

    Hi, I come from a background where I learned JavaScript as a standalone coding language, without a specific focus on web development. Should I prioritize learning DOM manipulation first to adapt quickly, or are there other aspects I should consider?

  • @hlahtunthein9455
    @hlahtunthein9455 5 หลายเดือนก่อน

    did you declare the tag before the html contents ??
    then let the script tag put buttom after the html tags

  • @manojmurugan590
    @manojmurugan590 ปีที่แล้ว

    How to contact you about courses please reply

  • @atifplaysfn5446
    @atifplaysfn5446 ปีที่แล้ว +1

    Bro how you attach html or css page in one file

  • @theoneandonly2441
    @theoneandonly2441 ปีที่แล้ว

    Thanks! Just a question, I saw your other video about the counter program and I was wondering what was the difference on using .textContent over .innerHTML to change the counter number on the js file?

    • @huydo1784
      @huydo1784 ปีที่แล้ว +2

      textContent: This property sets or returns the text content of the specified node and all its descendants. It treats everything as plain text, ignoring any HTML tags within the content. It's useful when you want to deal strictly with text and don't want any HTML formatting or interpretation.
      Example:
      const element = document.getElementById('exampleElement');
      console.log(element.textContent); // Retrieves the text content
      element.textContent = 'New text'; // Sets new text content
      innerHTML: This property sets or returns the HTML content (including tags) of an element. It allows you to manipulate the HTML structure and content of an element directly. It's powerful but should be used carefully as it can execute scripts and potentially create security vulnerabilities if the content isn't sanitized properly.
      Example:
      const element = document.getElementById('exampleElement');
      console.log(element.innerHTML); // Retrieves the HTML content
      element.innerHTML = 'New HTML content'; // Sets new HTML content

  • @murthysatti2035
    @murthysatti2035 หลายเดือนก่อน

    Hey bro can i know why you style class name although having id for div section in CSS file

  • @Misterkennedy04
    @Misterkennedy04 5 หลายเดือนก่อน

    transition is not working for me I typed ot the exact same way you did, I had to type color instead

  • @NickTorius
    @NickTorius 7 หลายเดือนก่อน +1

    Mine didnt work

    • @WaldeliceBraga
      @WaldeliceBraga 6 หลายเดือนก่อน

      Try again!
      My did but I'll set aside some time to redo it later.

  • @DamosyTheFreckle
    @DamosyTheFreckle 6 หลายเดือนก่อน

    I did this, it is amazing! But everytime I refresh or close tab, I lose the number where I previously left off. How do I make it such that everytime I refresh, i still get the previously stored number?

  • @Jamx971
    @Jamx971 5 หลายเดือนก่อน

    Hello ! thanks for this great content. I am trying to go further and I would like to not be able to go abo 0. I don't want -1 -2 etc...
    I've tried to add "while (count > 0)" in the function but it doesn't work.
    I am a beginner in JS but have some notions in Python.
    Can you please give me a hint?
    Thanks

    • @Jamx971
      @Jamx971 5 หลายเดือนก่อน

      decreaseBtn.onclick =function(){
      while (count>=1) {
      count--;
      }
      countLabel.textContent = count;
      }
      What is wrong with this?

  • @rafaelsfasie5347
    @rafaelsfasie5347 8 หลายเดือนก่อน

    Hello! Can You make a course of VueJS? IT will be very usefull.

  • @hunin27
    @hunin27 ปีที่แล้ว

    sorry for asking but if you could continue with the react tutorial ❤

  • @alif.mahmud
    @alif.mahmud ปีที่แล้ว

    I believe this topic was in the js course...🎉

  • @tadasmenulis8936
    @tadasmenulis8936 ปีที่แล้ว

    yea same have some erros for numbers define or others commands maybe are some settings what need know

    • @tadasmenulis8936
      @tadasmenulis8936 ปีที่แล้ว

      or some drives what are special for promaers if those etc

  • @manojmurugan590
    @manojmurugan590 ปีที่แล้ว

    Bro upload React full video please

  • @anonymous13378
    @anonymous13378 28 วันที่ผ่านมา

    my humor is so broken that I laughed on onLick

  • @persyout
    @persyout 11 วันที่ผ่านมา

    6:01

  • @capslock3250
    @capslock3250 ปีที่แล้ว

    Todo list?

  • @Saksham_1718
    @Saksham_1718 5 หลายเดือนก่อน

    my live previewing is not working within the vs code , can anyone suggest what's wrong????

  • @marialejandrachavez5379
    @marialejandrachavez5379 ชั่วโมงที่ผ่านมา

    it doesnt work. help

  • @pp04485
    @pp04485 6 หลายเดือนก่อน

    i think assigning a constant to the buttons was unneccesary

  • @codeguy11
    @codeguy11 ปีที่แล้ว

    Me: Creating counter program
    Me: Counting the times i failed/has bugs
    Below is the counter I made and each like is the amount of times i fail
    👇

  • @SoftwareTechByVP
    @SoftwareTechByVP 10 หลายเดือนก่อน

    Im put in increase de symbol + en decrease the symbol -

  • @sportsknowledge92
    @sportsknowledge92 11 หลายเดือนก่อน

    Hi bro code please make small small project like this

  • @EllisKankam
    @EllisKankam ปีที่แล้ว

    Bro code please we need django course

  • @precious_reads
    @precious_reads ปีที่แล้ว +1

    I did it wooohooo🫡

  • @1T_pressly
    @1T_pressly ปีที่แล้ว

    Your moving fast 😭

  • @Appwinkel
    @Appwinkel หลายเดือนก่อน

    This can an another way

  • @TorabekRaufov-p8x
    @TorabekRaufov-p8x 2 หลายเดือนก่อน

    random comment

  • @rayforever
    @rayforever ปีที่แล้ว +2

    TYPE SCRIPT !!! PLEASE BRO

  • @samuraijack8255
    @samuraijack8255 7 หลายเดือนก่อน

    THANKS MAN