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??
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?
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?
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
@@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.
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 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
@@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)
@@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
Leave a like if this video helped you, also give me feedback and suggestions for more projects!
How would I add commas to the count for big numbers?
how if i want the counter stop in 0,, if the number is 0 when user press minus button the count not get decrement
Short, precise and clear. Thank you!
Thank you :)
Thank you so much. These short easy examples really help to learn the basics propertly!
I love you random developer from youtube
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??
how can i add to the counter that id does not go below 0
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?
ohhhh maaaaan the way you code...ahhhh thanku so much,best code for beginner.
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?
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
@@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.
@@DamosyTheFreckle Hey, glad it worked :D
Your videos are amazing...
Thanks a lot!
If number 10 in counter how can automatic change color
Why not you defined the integer inside a function... Would you please tell me???
Thanks but i want to decrease number but not decreases less than 1 mean no negative num.
do you get the code??
Thanks this helped me!
dude,how do u make a limit to this count?e.g. number hits 0 and stops there?
if (number == yourNumberHere) {
removeEventListener(event, function)
}
this will remove the event listener and after the number hits the limit the increment button stops working
@@fattrat4292 do u know how to add a save score button???
@@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
@@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)
@@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
Thanks! Very helpful
how to do this in Matlab?
Can u reply here the code for my activity
More video please
Thank you. Helped me)
thanks bro !
very good thank you
thanks , very usefull
counter can't be in negative value.correct yourself