Тёмный
No video :(

Web Development Tutorial for Beginners #16 - JavaScript - Click Counter 

Tanner Crow
Подписаться 2,9 тыс.
Просмотров 7 тыс.
50% 1

Опубликовано:

 

27 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@darthscrotius3799
@darthscrotius3799 3 года назад
One thing to note that he just sorta skips over is the reason for ++ working and +=1 not working. ++ assumes the value is an integer, += does not. Therefore it treats the innerHTML value as it truly is, a string, and just concatenates onto the value ex: 0111111. This becomes important if say you wanted to increment or decrement by a value different than 1. You would need to parseInt the innerHTML to turn the string into an integer before manipulating it and then remember to reinclude the path back to where you want to put it. Be careful though, if you use parseInt you need to make sure there is a starting numeric value, so give your counter a starting value in the HTML such as 0 (makes sense) like he does. Otherwise you will get the result NaN (not a number). ex: let countNum = parseInt(document.querySelector('.countNum').innerHTML) function countUp(){ countNum+=2 document.querySelector('.countNum').innerHTML = countNum }
@parryhotter7036
@parryhotter7036 2 года назад
Thanks for the tutorial! Best ever Hope the next vids including source code 🌿
@MEXcze
@MEXcze 4 года назад
great video. Thank you :D
@vampyauto8128
@vampyauto8128 3 года назад
Hi, thank you for the lesson. I have one problem, when I press the button instead of the numbers going it, NaN just pops up. Could you please help me? Thanks!
@darthscrotius3799
@darthscrotius3799 3 года назад
see my comment above, it may help you. I explain one reason for getting NaN. Though you posted this 2 months ago so likely you figured out your issue by now
@178lec
@178lec 3 года назад
thank you for the lesson. I would like to use the counter with other person, and the counter still have the value before refresh
@yacomedinav
@yacomedinav 3 года назад
Same here, please
@aunglaychannel4918
@aunglaychannel4918 3 года назад
thank for your lesson
@jerrywong4951
@jerrywong4951 3 года назад
Great!
@adityajaiswal9993
@adityajaiswal9993 4 года назад
thanks man!
@CodingClub
@CodingClub 4 года назад
You’re welcome! Glad it helped!
@hopetangunu7296
@hopetangunu7296 3 года назад
How would I add commas to the count for big numbers?
@charlesmatthewcoming5211
@charlesmatthewcoming5211 4 года назад
Hi! can i have the source code?
@aaryansachdeva
@aaryansachdeva 3 года назад
don't be lazy
Далее
Counter program in JavaScript ↕️【3 minutes】
3:40
Музыкальные пародии
00:28
Просмотров 23 тыс.
How to use CSS object-fit to control your images
6:01
Просмотров 432 тыс.
How to make a click counter in HTML/JAVASCRIPT. 2EZ
3:21
How Minecraft Surpassed the Game it Copied
10:08
Просмотров 216 тыс.