Simple Counter | Javascript Beginner Project Tutorial

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

КОМЕНТАРІ •

  • @CodePhilipYT
    @CodePhilipYT  4 роки тому +9

    Leave a like if this video helped you, also give me feedback and suggestions for more projects!

    • @hopetangunu7296
      @hopetangunu7296 3 роки тому

      How would I add commas to the count for big numbers?

    • @patrickmardiyanto7748
      @patrickmardiyanto7748 3 роки тому

      how if i want the counter stop in 0,, if the number is 0 when user press minus button the count not get decrement

  • @yy.u.i
    @yy.u.i 7 місяців тому +1

    Short, precise and clear. Thank you!

  • @CzEnglish
    @CzEnglish 2 роки тому

    Thank you so much. These short easy examples really help to learn the basics propertly!

  • @alexanderblack8
    @alexanderblack8 4 роки тому +3

    I love you random developer from youtube

  • @pratitibera8639
    @pratitibera8639 4 роки тому +2

    Can you do the same for multiple input fields? But the same increment and decrement functions should be called for all the fields. Can you do that using javascript only??

  • @ianmotaln
    @ianmotaln 2 роки тому

    how can i add to the counter that id does not go below 0

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

    Thanks for the video. How would you save the incremented value and then add the saved value in a result? For example, you are counting the number of the guests that entered the bus. Then you click the total button to see how many guests entered the bus?

  • @hassanbajwa5640
    @hassanbajwa5640 4 роки тому

    ohhhh maaaaan the way you code...ahhhh thanku so much,best code for beginner.

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

    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?

    • @CodePhilipYT
      @CodePhilipYT  5 місяців тому

      Hey, for that u need to store the value. You could use a database or localstorage. Maybe you can read into that. You will need to run it on a server though, for local development xampp is best as you can also use sql databases there! Good luck

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

      @@CodePhilipYT Thanks for replying! I managed to implement firebase firestore in my project and it worked out pretty well for me. Will certainly try out the other forms of databases in the near future.

    • @CodePhilipYT
      @CodePhilipYT  4 місяці тому

      @@DamosyTheFreckle Hey, glad it worked :D

  • @studyireland
    @studyireland 2 роки тому +1

    Your videos are amazing...

  • @kottamanvith3120
    @kottamanvith3120 Рік тому +1

    Thanks a lot!

  • @AtomTCP
    @AtomTCP 3 роки тому

    If number 10 in counter how can automatic change color

  • @ujjwalanand6687
    @ujjwalanand6687 3 роки тому

    Why not you defined the integer inside a function... Would you please tell me???

  • @webber5629
    @webber5629 3 роки тому +1

    Thanks but i want to decrease number but not decreases less than 1 mean no negative num.

  • @sultanrasul2794
    @sultanrasul2794 2 роки тому +1

    Thanks this helped me!

  • @ripplesr5655
    @ripplesr5655 3 роки тому +1

    dude,how do u make a limit to this count?e.g. number hits 0 and stops there?

    • @fattrat4292
      @fattrat4292 3 роки тому

      if (number == yourNumberHere) {
      removeEventListener(event, function)
      }
      this will remove the event listener and after the number hits the limit the increment button stops working

    • @cheetos9818
      @cheetos9818 3 роки тому

      @@fattrat4292 do u know how to add a save score button???

    • @fattrat4292
      @fattrat4292 3 роки тому

      @@cheetos9818 do u just want the website to display the score on the screen or console.log it or actually store it so that next time when u open the website u can access the stored number

    • @fattrat4292
      @fattrat4292 3 роки тому

      @@cheetos9818 if you just want to display it then you can just make a new div element or p element and do document.getElementById('yourDiv').innerHTML = theScore
      now "theScore" will be the element that specifies the score/number so whenver it changes the saved score changes too(i think it changes, it might now i haven't really done it)

    • @patrickmardiyanto7748
      @patrickmardiyanto7748 3 роки тому

      @@fattrat4292 dude if i hits the limit is 0 so when my number start from 0 the event will can't running,, i need your help when i press the plus button counter get increments but when i press the minus button the limit is 0

  • @swathivenkatesh465
    @swathivenkatesh465 3 роки тому +1

    Thanks! Very helpful

  • @marvingazo2140
    @marvingazo2140 4 роки тому

    how to do this in Matlab?

  • @lajigsaa4982
    @lajigsaa4982 2 роки тому

    Can u reply here the code for my activity

  • @gaurangraut1717
    @gaurangraut1717 3 роки тому +1

    More video please

  • @romaromanych4832
    @romaromanych4832 4 роки тому +1

    Thank you. Helped me)

  • @Servetcan
    @Servetcan 3 роки тому

    thanks bro !

  • @rjtkoh
    @rjtkoh 4 роки тому

    very good thank you

  • @otmanechentoufi4894
    @otmanechentoufi4894 4 роки тому

    thanks , very usefull

  • @amnaramzanawan2046
    @amnaramzanawan2046 2 роки тому

    counter can't be in negative value.correct yourself