Beginner Vanilla Javascript Project Tutorial

Sdílet
Vložit
  • čas přidán 10. 04. 2020
  • Get The Full Javascript Course Here!
    developedbyed.com/
    In this episode we are going to cover a small project of the full Creative Javascript Course, a todo list in vanilla js.
    We are going to put together all the fundamental javascript techniques including local storage.
    Check out the javascript course in the link above to create more complex javascript projects and understand complex topics.
    🎁Support me on Patreon for exclusive episodes, discord and more!
    / dev_ed
    🛴 Follow me on:
    Twitch: / developedbyed
    Twitter: / developedbyed
    Instagram: / developedbyed
    Github: github.com/developedbyed/
    Microphones I Use
    Audio-Technica AT2020 - geni.us/Re78 (Amazon)
    Deity V-Mic D3 Pro - geni.us/y0HjQbz (Amazon)
    BEHRINGER Audio Interface - geni.us/AcbCpd9 (Amazon)
    Camera Gear
    Fujifilm X-T3 - geni.us/7IM1 (Amazon)
    Fujinon XF18-55mmF2.8-4 - geni.us/sztaN (Amazon)
    PC Specs
    Kingston SQ500S37/480G 480GB - geni.us/s7HWm (Amazon)
    Gigabyte GeForce RTX 2070 - geni.us/uRw71gN (Amazon)
    AMD Ryzen 7 2700X - geni.us/NaBSC (Amazon)
    Corsair Vengeance LPX 16GB - geni.us/JDqK1KK (Amazon)
    ASRock B450M PRO4 - geni.us/YAtI (Amazon)
    DeepCool ATX Mid Tower - geni.us/U8xJY (Amazon)
    Dell Ultrasharp U2718Q 27-Inch 4K - geni.us/kXHE (Amazon)
    Dell Ultra Sharp LED-Lit Monitor 25 2k - geni.us/bilekX (Amazon)
    Logitech G305 - geni.us/PIjyn (Amazon)
    Logitech MX Keys Advanced - geni.us/YBsCVX0 (Amazon)
    DISCLAIMERS:
    I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
    #programming #javascript
  • Věda a technologie

Komentáře • 1,8K

  • @briandesign
    @briandesign Před 4 lety +341

    Dope! Already got in the course and built a few of the projects

  • @developedbyed
    @developedbyed  Před 4 lety +432

    Thanks for everyone who joined The Creative Javascript Course!

    • @giiipfel
      @giiipfel Před 4 lety +4

      Thank you for making this courses, you are the best!

    • @journey_to_100
      @journey_to_100 Před 4 lety

      Thanks

    • @dadan.dahman.w
      @dadan.dahman.w Před 4 lety

      Luar biasa

    • @thorwd
      @thorwd Před 4 lety

      I'm really enjoying your course, even for an intermediate JS developer, I did learn new things 😃

    • @nocode659
      @nocode659 Před 4 lety +3

      PLEASE UPLOAD COURSE IN UDEMY, MANY WILL ENROLL PLS

  • @naidenmatyas925
    @naidenmatyas925 Před 4 lety +219

    man, you're great!even if you sayd that you're not gonna give the course for free you're still posting some of you're hard work for free!keep the hard work

  • @michaelvigato3228
    @michaelvigato3228 Před 4 lety +29

    It would be very cool to see a follow up to this tutorial in which you show how to save stuff on firebase, instead of local storage :)

  • @domenicocucinotta2720
    @domenicocucinotta2720 Před 3 lety +6

    Thanks Ed for your time and for this fantastic tutorial! I have learned tons! The last part (local storage bit) was quite tricky for me as beginner so I had to go through it multiple times! Cheers!

  • @arwahsapi
    @arwahsapi Před 4 lety +549

    Pandemic ends.
    Everyone turns programmer.

  • @LuBre
    @LuBre Před 4 lety +114

    "That's not a fart, that's the chair"
    *Subscribed*

  • @ghoulishwargamer
    @ghoulishwargamer Před 4 lety +6

    Another way you could save the items into local storage is saving them as objects, along with the status i.e, {'text': 'todoText', 'status': 'complete'}. With some additional work you can then save the state of each todo item and set the necessary styling when refreshing the page. Great tutorial!

  • @primeshmohanty7701
    @primeshmohanty7701 Před 4 lety +3

    I was literally looking for something like this on your channel. I love you so much!

  • @cansatc5873
    @cansatc5873 Před 3 lety +93

    If you're getting the cannot read/set display or contains error for the filterTodo function after the 54th minute, you can change the code as follows:
    function filterTodo(e) {
    const todos = todoList.childNodes;
    todos.forEach(function (todo) {
    const mStyle = todo.style;
    if(mStyle != undefined && mStyle != null){
    switch (e.target.value) {
    case "all":
    mStyle.display = "flex";
    break;
    case "completed":
    if (todo.classList.contains('completed')) {
    mStyle.display = 'flex';
    } else {
    mStyle.display = "none";
    }
    break;
    case "uncompleted":
    if (todo.classList.contains('completed')){
    mStyle.display = 'none';
    }
    else{
    mStyle.display = "flex";
    }
    break;
    }
    }
    })
    }
    Although I struggled for a long time, I could not solve this problem and my developer friend offered this solution. Thank you again here.

    • @bearchemist2286
      @bearchemist2286 Před 3 lety +3

      Thank you for this so much. Can you explain why this fixes the issue? To me this just looks like a check to see if todo.style is undefined and if not, continues to the switch.

    • @ponderingPenguin02
      @ponderingPenguin02 Před 2 lety +2

      Thank you for saving me loads of head ache :)

    • @gamalabdu8374
      @gamalabdu8374 Před 2 lety +4

      Thank you! I spent an hour trying to figure out why my code was exactly what he typed but didn't work. Do you know why this was an issue? I didn't have an issue until then.

    • @zakur0hako
      @zakur0hako Před 2 lety +1

      thanks a lot. now somebody needs to find the reason why it works like this

    • @MuhammadJaved-bb4cx
      @MuhammadJaved-bb4cx Před 2 lety

      Thanks! your method works.

  • @techcanyon411
    @techcanyon411 Před 4 lety +2

    It is a blessing and a thing of joy to meets someone who want you to grow.

  • @tonybalde4298
    @tonybalde4298 Před rokem +9

    The fact that he makes mistakes, identifies them and explains how to solve them, makes this video more incredible!

  • @Anderzon1994
    @Anderzon1994 Před 4 lety +5

    Hey Ed ! Thanks for sharing your knowledge man. I'm learning a lot of things with your videos. Your explanations are amazing and I have fun watching your videos! Most of the JS that I know it's because of you bro I love you man, thanks for everything.

  • @CarlosGoncalves-mb9cy
    @CarlosGoncalves-mb9cy Před 4 lety +4

    Amazing tutorial, thanks man the way you explain makes everything so clear.

  • @BoisNation
    @BoisNation Před 4 lety

    Exactly what I have been looking for. I just started learning some JavaScript after finishing HTML and CSS. This project was perfectly fit for me and it was very nice of you to post some of your hardwork for free on CZcams. Keep it up!

  • @flatlinejimbob
    @flatlinejimbob Před 3 lety +1

    Currently studying web development and my local government institute of learning, this has been way more engaging and easy to follow than anything they have thrown at us this year. Thank you! I have signed up for the course :D

  • @SmeSSS
    @SmeSSS Před 4 lety +3

    Thank you for this small little project Ed. Much appreciated!

  • @tshaylatte9502
    @tshaylatte9502 Před 4 lety +5

    I like the fact you make errors and show how to search for them 👍🏾

  • @RicardoSilvaTripcall
    @RicardoSilvaTripcall Před 4 lety +1

    Amazing project and Channel, Congrats!!! I've been long years away from the front end and Java Script an this was an amazing refresh. Going to explore and study the code more thorough now.

  • @fhkodama
    @fhkodama Před 3 lety +2

    Ed, thank you very much! My first project. It was incredible to organize my thoughts on how to use HTML, CSS, and JS, all together! :) Perfect!

  • @sambathadev
    @sambathadev Před 4 lety +9

    Yeeeeeeeee another one from my fav developer.... Love from the smallest country in West Africa, The Gambia

  • @ShadowHeroo
    @ShadowHeroo Před 4 lety +16

    I already know some JavaScript, but I bought this course to skill myself up. So far this course is awesome and worth the money.
    You nice, keep going my gorgeous teacher :))))))

    • @mdshahab8507
      @mdshahab8507 Před 4 lety

      JS code is not wroking in my sublime 3.2.2, please help

    • @AbbasAli-ep3kb
      @AbbasAli-ep3kb Před 3 lety

      bro can you plz give me this course that you bought I'll be thankful for this favor

    • @vietanhhoang2642
      @vietanhhoang2642 Před 3 lety

      bạn có thể chia sẻ cho tôi được không

    • @duplicpapers8753
      @duplicpapers8753 Před 3 lety

      @@mdshahab8507 sublime is better for stuff like HTML and css try VS code :D

  • @_aguskhaer
    @_aguskhaer Před 3 lety +2

    In the beginning of this video, i've got entertained while i'm super dizzy to start learning javascript. Thanks for this entertaining + educating video, you're awesome!

  • @michaelhajny783
    @michaelhajny783 Před 3 lety

    I appreciate your attention to make everything clear enough and also that you teach us something about what are you actually do console and vs code. I realy like contents that you produce. It is a clear understandable and also funny. THANK YOU a lot.

  • @JohnyFretka
    @JohnyFretka Před 3 lety +101

    When selecting 'all', 'completed' or 'uncompleted' I found that click event in filterOption eventlistener works only in Firefox for me. To make it work in Chrome as well I needed to put 'change' instead of 'click'.

    • @JordanKimsey
      @JordanKimsey Před 3 lety +1

      Thank you so much! I was going crazy trying to figure out why it was behaving like this.

    • @diegofernandez6082
      @diegofernandez6082 Před 3 lety

      Thank you man, i was wondering if it was just me lol

    • @khaledlakehal5450
      @khaledlakehal5450 Před 3 lety

      😳Thank you

    • @chonka_poodge
      @chonka_poodge Před 3 lety

      thanks worked for me!!

    • @nefeles5615
      @nefeles5615 Před 3 lety +4

      Thank you so so much!!! I spent a whole hour checking the code over and over to see what was wrong.

  • @yakimura96
    @yakimura96 Před 4 lety +37

    I bought the course, but I am very proud of you sharing this project, knowledge for everyone.

    • @jamesfowler6343
      @jamesfowler6343 Před 4 lety

      Tony can I ask how you are finding the course ?

    • @yakimura96
      @yakimura96 Před 4 lety

      @@jamesfowler6343 I haven't finished the course yet

    • @umeraftab6494
      @umeraftab6494 Před 4 lety

      can you share project :( i cant buy man :( very poor but love to learn if you can i will be glad :( umeraftab4422@gmail.com

  • @nadinandfamily6201
    @nadinandfamily6201 Před 3 lety

    Thanks so much for such great project. It took me several days to understand each part of it, to make a lot of notes and even to add some new features!!! You are going a great job! Will be waiting new projects

  • @joshterryplays
    @joshterryplays Před 3 lety +2

    This was great. Thank you. I went through the whole thing with you on my own editor. Really appreciate it.

  • @journey_to_100
    @journey_to_100 Před 4 lety +4

    Was going to start TODO list before 7hours ..
    but i saw your new video is up and luckily it was todo list..
    i am gonna start right now..
    i love your sense of humour 😂😂..
    keep going broo..
    ❤ From INDIA

  • @tanvirashraf728
    @tanvirashraf728 Před 4 lety +79

    Beother Ed i was confused about whether i am gorgeous or not , but you have cleared my confusion....

  • @kramyshan8121
    @kramyshan8121 Před 2 lety

    Excellent work here, you rock! The local storage part is the best on the internet so far. Keep it up and thank you very much!

  • @fernandocorenstein6531
    @fernandocorenstein6531 Před 4 lety +2

    Hi Ed, I know your channel from a few months back when I started learning Python. Just purchased your courses for HTML,CSS & JS. Thank you for the great content!

  • @mikebrown8239
    @mikebrown8239 Před 4 lety +3

    Thank you so much for this. I appreciate you giving some of your paid courses for free. Keep up the good work! You're AWESOME!!!

  • @gookanga
    @gookanga Před 4 lety +7

    Ed and De Gea look so much alike, especially when he put those glasses on.

  • @atifaslam2965
    @atifaslam2965 Před 3 lety

    gorgeous brother, you taught me well . i came for the local storage part but after watching full video.. i learned many new concepts. thnx

  • @emarroqu100
    @emarroqu100 Před 3 lety +1

    To DevEd: Thank you, mon ami. Your tutorials are awesome. Learning a lot from you. JS is new to me as I come from legacy/mainframe development.
    To: Byron Jones: Thank you, brother. Your alternate approach to solve ["cant read property contains of undefined"] works well. I spent a couple of hours troubleshooting on my own w/o success.

  • @mohamedmidou3494
    @mohamedmidou3494 Před 4 lety +4

    Thank you so much this Tutorial really helped me practicing my JS knowledge ♥

  • @parsa6043
    @parsa6043 Před 4 lety +39

    I'll wear some shades next time, when I build a todo list for the 1000th time

  • @sibusisosiyabongandaba698

    This was hello of a session, did every line with you. 🙂 Great stuff, keep it up

  • @jonathankibet9750
    @jonathankibet9750 Před rokem

    its amazing how you can squeeze so much content into an hour of video. Nice stuff man .Found my GRIT again!!

  • @mattyxow
    @mattyxow Před 3 lety +11

    Something: **doesn't work**
    Him: **visible panic**
    Something: **doesn't work**
    Me: ah shit, here we go again

  • @mohamadnagiebrahim
    @mohamadnagiebrahim Před 4 lety +4

    thanks for the effort!
    the event.preventdefault(); does not work, and the page keeps on refreshing, any help please ?

    • @finchaser
      @finchaser Před 4 lety +1

      i have the same problem

  • @doniyorabduvokhidov1706
    @doniyorabduvokhidov1706 Před 4 lety +1

    Tons of thanks , I just intended to learn Vanilla JS but I also learnt CSS, it was incredible

  • @pweezy001
    @pweezy001 Před 2 lety

    Thank you soooooo much for this video Ed, I've been struggling with this code for the past hour! You're a life saver!

  • @alivakili2770
    @alivakili2770 Před 4 lety +4

    Thank you for the amazing tutorial. I appreciate it. just one concern! after loading again the page, the items which checked or completed before would not be checked or completed anymore. how to fix it?

    • @yltfy
      @yltfy Před 3 lety

      Basically, it's not sufficient to store only the todo content to the local storage. You'll also have to store a boolean indicating whether it is completed, and then render the style accordingly. Instead of storing todos = ["learn javascript", "get up early", "hello"], you need to store something like todos = [{content: "Learn javascript", completed: false}, {content: "get up early", completed: true}, {content: "hello", completed: true}].

  • @serousetrick
    @serousetrick Před 2 lety +4

    Great tutorial Ed, it was fun doing this project. The only problem that I have is when I delete todo, instead of it there will be blank space. For example, if I want to delete only the first "todo" by clicking on the trash button, after animation on its position there is an empty row and the second "todo" won't climb up. Any help with this?

  • @alexlegoG
    @alexlegoG Před 2 lety +1

    Extraordinary tutorial! This was incredibly helpful! Thank you very much for everything!

  • @shafnisha1171
    @shafnisha1171 Před 8 měsíci +1

    Loved this explanation, thankyou ed!

  • @sunnydivino
    @sunnydivino Před 2 lety +7

    Thank you so much, Ed! I learned a lot from this video.
    I got stuck by the minute 48 when toggling the completed to-dos, for a reason the children in the nod list were undefined. After hours of checking my code line by line, I solved it by replacing my HTML body with the one from your repo. Although it was the very same code, except for one space between the footer and the script tag. Didn't know what could have been wrong with mine.
    Great video!!! I enjoyed it so much.

    • @thecoderguy2566
      @thecoderguy2566 Před 2 lety +1

      yes , right , I too got there stuck , and after formatting it , the code worked perfectly fine , I had to console log again and again and got white space as well ,
      but it is not clearly mention that why this issue happened , for anyone facing this problem can select all and press shift + alt + f ,
      in short : " ctrl + a " and then " shift + alt + f "
      do check if it works

  • @sergiorejtman
    @sergiorejtman Před 3 lety +22

    Hey guys, there is a small LOGIC GAP here, if you set the filter to "uncompleted" and check a new item, that item will not hide immediately, as it should. The fix is simple: Inside function filterTodo(), instead of doing switch(e.target.value) you should do switch(filterOption.value). That will allow function filterTodo() to be called anytime, not only inside the 'click' event. Then you just add filterTodo(); as the last line inside the block "if (item.classList[0] === 'complete-btn')" inside function deleteCheck(). That will call funtion filterTodo() right after the item is checked, updating the screen!

    • @GamestarsBulgaria
      @GamestarsBulgaria Před 2 lety +1

      doesnt work :(

    • @zyx138
      @zyx138 Před 2 lety

      thank you so much!!

    • @anjanipriyanka7575
      @anjanipriyanka7575 Před rokem

      😇thanks

    • @utsavkashichhwa
      @utsavkashichhwa Před rokem

      There is still another problem. When you set filter to 'complete' then add a new item, the item will not hide immediately. The first thing is to modify the filterTodo() function, like mentioned above, so it can be used without the event argument. Then make sure to call the filter funtion when you change the filter, add a new todo, or change the state of a todo by adding event listeners to the relevent elements: [filterOption, todoButton, todoList].forEach((element) => element.addEventListener('click', filterTodos));.

    • @danielmbirch
      @danielmbirch Před rokem +1

      This works great, thank you. The only issue I'm having is the select field only actions the second time you click it. Click once to get the drop down, select an item (nothing happens yet) but click on the select element again and the selection you previously made actions. Anyone have any ideas? My code is the same as the tutorial, checked many times over, I'm thinking since this tutorial was made 2+ years ago, there have been browser or JS changes which is causing this??

  • @00el04
    @00el04 Před 4 lety +2

    these are the type of tutorial i LOVE! thanks so much

  • @technonessteam7511
    @technonessteam7511 Před 3 lety +1

    Thank you so much for creating this tutorial. You have done an amazing job. Really impressive. Please bring more Vanilla JavaScript projects with such great detailing. Really thank you. stay blessed

  • @BasedGob
    @BasedGob Před 3 lety +6

    In the filtering part, for some reason my todoList.childNodes contained an extra "text" node in addition to the various divs representing todo items. This was causing it to break so I added an additional if statement to filter those out:
    todos.forEach(function(todo) {
    if (todo.nodeType == Node.ELEMENT_NODE) {
    switch(e.target.value) {
    ...

    • @klaudiaa483
      @klaudiaa483 Před 3 lety +1

      I had the same problem. Now that I've added the line of code you've written it works. Thanks for sharing! :)

    • @curtishenley3538
      @curtishenley3538 Před 2 lety +1

      Thank you!!! I was debugging for soooo long.

    • @frmcf
      @frmcf Před rokem

      Thank you! I had the same problem, and almost got to the same solution as you, I was just missing the '.nodeType'!!!

  • @imPriyankCoder
    @imPriyankCoder Před 4 lety +3

    thank you ed for your kindness. Could please add this type of course in react or angular there is lot of demand for those programming language. Would you be doing same kind of course please paid ofc i meant

  • @sejaldahake2745
    @sejaldahake2745 Před 3 lety

    Thank you so much Dev :)) You were so good at explaining every detail. Had a great time doing this one. :) Love

  • @technonessteam7511
    @technonessteam7511 Před 3 lety

    Your way of teaching is so relaxed and really good. Keep up the good work

  • @muhammadans7071
    @muhammadans7071 Před 4 lety +9

    i am facing problem in filtration and also display property can't set
    todo.style.display = "flex";
    Uncaught TypeError: Cannot set property 'display' of undefined

    • @arpantimsina1805
      @arpantimsina1805 Před 3 lety +6

      for the people that are getting the error of ["cant read property contains of undefined"] you have to check if you left space in the tag and because of that when you get the list of nodes you always get a "Text" node with no class and that causes the problem.

    • @andyjohn907
      @andyjohn907 Před 3 lety

      @@arpantimsina1805 thanks was having same problem

    • @youssefbaaziz3673
      @youssefbaaziz3673 Před 3 lety

      @@arpantimsina1805 thankssssss

    • @rain-techstudio2567
      @rain-techstudio2567 Před 2 lety

      @@arpantimsina1805 wow you Rock!

  • @flaviusmiron4041
    @flaviusmiron4041 Před 3 lety +6

    "EH, why u do this to me" lmaoo 49:12

  • @hillelcohen3878
    @hillelcohen3878 Před 3 lety

    Awesome! Really got an incredible amount of knowledge in a short time. Thanks!

  • @GoodBoy-yu2rk
    @GoodBoy-yu2rk Před rokem

    it feels like a fun journey listening to your lesson, keep it up!

  • @trystandbannon
    @trystandbannon Před 4 lety +15

    For some reason my todos filter doesnt update until i click on it again, how do I make it happen right when i click the option i choose?

    • @0rdsec
      @0rdsec Před 4 lety +16

      just had this same issue. in the event listener for filterOption, use 'input' instead of 'click'

    • @mimkii8369
      @mimkii8369 Před 4 lety +3

      @@0rdsec Thanks for the solution! I had the same issue..why was that happening?

    • @0rdsec
      @0rdsec Před 4 lety +4

      @@mimkii8369 i'm no expert, but i think it's because a click listener doesn't provide the behaviour we need, which is displaying certain todos based on what we select in the dropdown, upon selection. the click listener only cares about whether something's been clicked, whereas we need things to filter when the selected option in the dropdown CHANGES. dropdowns seem like a dark art :)

    • @flo_dev
      @flo_dev Před 4 lety

      You rock !

    • @aakashkharche9429
      @aakashkharche9429 Před 4 lety

      I am getting 4 in nodelist even if 3 are added and first is text and due to this getting error.Can u help

  • @katianddav
    @katianddav Před 4 lety +14

    Could you put readyproject to download ? I have some problems...

    • @vaniad555
      @vaniad555 Před 4 lety

      yes, copy & paste at the end messed up my entire js , wish I had the full page of code to see where I missed a dot, hard to read the lines after hours of following that handsome guy...:)

  • @AlbertoRivas13
    @AlbertoRivas13 Před 4 lety +1

    Thanks a lot for making this project man, it was really useful

  • @VHCreator
    @VHCreator Před 4 lety

    56:44 this guy turns off caps lock with a voice command, pretty cool imo. Just finished this video, amazing. Im coming from Java and need to do a project in web dev course im enrolled in collage. You are providing very helpful videos, thank you.

  • @nehakumar9889
    @nehakumar9889 Před 4 lety +8

    Thank you so much Ed Sir ❤ I actually don't have enough pocket money left and due to ny degree expenses and other stuffs.My parents won't be able to give me extra bucks for online courses. Thanksss a lott for putting this online :) for free.... I wish majority of the learners enroll into this course because you're awesome professor Ed :)

  • @utkarshgupta3209
    @utkarshgupta3209 Před 3 lety +3

    23:44 my program is not working, nothing is happening when I click the 'plus' sign. Please help.

    • @guithegood87
      @guithegood87 Před 3 lety

      I have the same issue, when cliecked the chrome console warns about a "Uncaught TypeError: todo.classList.toogle is not a function
      at HTMLUListElement.deleteCheck".

    • @carlosantoniomarroquin5520
      @carlosantoniomarroquin5520 Před 3 lety +2

      @@guithegood87 It's not toogle is toggle, you have two o's instead of two g's . That's why it says that is not a function.

    • @00el04
      @00el04 Před 3 lety

      have you fixed the problem?

    • @severussin
      @severussin Před 3 lety

      @@00el04 My JS doesn't appear to run on my page after literally copying and pasting his JS code into my editor. Any ideas?

  • @mateuszzielinski
    @mateuszzielinski Před 3 lety

    Hello Ed! I am beginner and challenged myself to save "checked" status also. It took me about one day but I managed to do that. It wouldn't be possible without your great tutorial about localStorage. It was a great splice(), indexOf(), includes() training also! Thank you for sharing knowledge!

    • @shantisuma7738
      @shantisuma7738 Před 11 měsíci

      can you share that code for checked in local storage

  • @johnatteo822
    @johnatteo822 Před 2 lety

    Ed you are my favorite person. I'm buying your Javascript course so I can do more projects. Thank-you for sharing your knowledge to help others like me strive! 👍

  • @MinecraftVinesFHAM
    @MinecraftVinesFHAM Před 4 lety +6

    Is anyone having trouble with filtering the completed/uncompleted tasks? I'm copying the code straight from him and it doesn't seem to work for me.
    I noticed this error I'm receiving in the console.log whenever I click the dropdown box.
    Uncaught TypeError: Cannot set property 'display' of undefined
    at app.js:77
    at NodeList.forEach ()
    at HTMLSelectElement.filterToDo (app.js:72)
    Would love some help if possible!
    Thank you

    • @SmeSSS
      @SmeSSS Před 4 lety

      I have the same problem. I think the error occurs, because if you check what console.log(todos) does after the "const todos = todoList.childnodes;" line, then you'll see, that we have an unneccesary element in the NodeList.
      Even though you add 0, 1, 2 or 3.... items, there will be always 1 more in the NodeList, because the first one will be a 'text' element, like this:
      NodeList(3) [text, div.todo, div.todo]
      I'm not sure why does it gets added. It has a wholeText: "↵↵ ". I'd also appreciate some insight if someone has. :)

    • @hwangdoo5515
      @hwangdoo5515 Před 4 lety

      me too, I need to some helps @@

    • @hwangdoo5515
      @hwangdoo5515 Před 4 lety +2

      @@SmeSSS I think i can fix it, try remove all spaces in ul in html.
      code:
      ""

    • @SmeSSS
      @SmeSSS Před 4 lety +1

      @@hwangdoo5515 You are absolutely spot on. Nice thinking, good job! =]

    • @ThatGuyDownInThe
      @ThatGuyDownInThe Před 4 lety

      @@hwangdoo5515 yo HOW did you figure that out??

  • @alexandros6453
    @alexandros6453 Před 4 lety +6

    Great tutorial Ed! I faced an error in the filter function and don't know exactly what went wrong :( Where can i find the source code to check the issue? Thanks again!

    • @HermanRas
      @HermanRas Před 4 lety +2

      anyone completed the project ? please share Code :)

    • @harshmellow3549
      @harshmellow3549 Před 4 lety +6

      @@HermanRas from a comment above you :
      for the people that are getting the error of ["cant read property contains of undefined"] you have to check if you left space in the tag and because of that when you get the list of nodes you always get a "Text" node with no class and that causes the problem.

    • @alexandros6453
      @alexandros6453 Před 4 lety

      @@harshmellow3549 that was the problem! you are great:)

    • @rayhanmahmud6589
      @rayhanmahmud6589 Před 3 lety

      @@harshmellow3549 Thank you so much! This problem was driving me crazy!

    • @victorramirez5605
      @victorramirez5605 Před 2 lety

      @@harshmellow3549 wow such a small detail was creating a huge problem. thanks.

  • @Amar11115
    @Amar11115 Před rokem

    I don't know how I should thank you.
    Really enjoyed the tutorial. Learned a lot.
    Of course there are 1-2 things I haven't comprehend properly but I will clear them up.
    Just want to say, you are awesome!

  • @dipokchandra264
    @dipokchandra264 Před 2 lety

    I just found a brand new tutorial in skillshare about the "Complete and Creative Javascript Course." That's the great tutorial I have seen ever. I am in class 23. Thank you so much, man! You are great.

  • @joshuachisunka5887
    @joshuachisunka5887 Před 3 lety +4

    Thanks for the course Dev Ed, I love your tutorial videos. They are good for practice and the results are awesome. I had a problem with making the list appear when I click the add button. My page keeps refreshing each time I click the add list button. Where could I have gone wrong?

    • @severussin
      @severussin Před 3 lety +2

      Having a similar issue with the javascript elements on this tutorial.

    • @hariprasad467
      @hariprasad467 Před rokem +1

      Use prevent default method

  • @Webbi_Trax
    @Webbi_Trax Před rokem +3

    Hey guys! Im having a bug, maybe you could help. When I press one of the options in the select dropdown menu, the todo list does not update. Only when I press the select menu again it updates.....
    ....UPDATE: I just cloned the repo from Dev ED, and his code has the same bug. It could have something to do with my Browser. I am running Chrome....
    The problem seem to be that. the filterToDo function does not fire when i press the options in the drop down menu, only when I press the select element does the function fire
    UPDATE: Found the solution: use the 'change' eventlistener, instead of 'click' on the filterOption function :-)

    • @tanmay6207
      @tanmay6207 Před rokem

      thank you so much for this! :)

  • @DMMarch
    @DMMarch Před 4 lety

    Nice one matey looking forward to doing the course

  • @noquarter1983
    @noquarter1983 Před 4 lety +1

    This was a fun project and a great addition for a portfolio item! Thanks

  • @sakshilalchandani7944
    @sakshilalchandani7944 Před 4 lety +3

    23:41 why can't I see the li's on the page, when I hit submit button

    • @TheShowTimeElites
      @TheShowTimeElites Před 4 lety +2

      im having the same problem

    • @ThomasWilliamson
      @ThomasWilliamson Před 4 lety +2

      I am also having the same problem, anyone figured it out?

    • @notonlymusicmixes181
      @notonlymusicmixes181 Před 4 lety +1

      Same here. My page refreshes when I click the button, but nothing else happens. I also added event.preventDefault(); .....feels bad

    • @joshgordon7299
      @joshgordon7299 Před 3 lety

      i fixed my problem i figured out i had mine todoDiv.classList() instead of todoDiv.classList.add('todo-item')

  • @elidayjuma
    @elidayjuma Před 4 lety +3

    I have always been waiting for this moment... COMMENT NUMBER ONE

  • @sharriceowens913
    @sharriceowens913 Před 3 lety

    thank you for helping me with my first javascript project around the 1 hour mark it got a lil difficult to understand but i think if i do a lil research ill understand exactly what was done and why

  • @pvd4170
    @pvd4170 Před rokem

    Thank you for a great tutorial! Decided to learn all html, css and js stuff by doing, and you are helping a lot!!!!🔥🔥🔥

  • @maayanzakuta5328
    @maayanzakuta5328 Před rokem +3

    If you're getting the cannot read/set display or contains error for the filterTodo function after the 54th minute it's bc you have to check if the starting "ul" and the closing "ul" in line 30 of the index IS IN THE SAME LINE and that the closing ul is not a line below bc if it is it'll take "text" as first child and mess up the childNodes which is why u get this error.

    • @tanmay6207
      @tanmay6207 Před rokem

      was stuck at this! :') Thanks a lot

    • @diamondsinyoureyes
      @diamondsinyoureyes Před rokem

      omg thank youuuu. I was up to the filter option and nothing was changing when changing the select dropdown. I went through the video again and again! adding into my html made everything work properly. Never would have found this without your comment!

    • @aviraljain8785
      @aviraljain8785 Před rokem

      great eye u got. Thanks !

  • @nitishroat
    @nitishroat Před 3 lety +8

    2:47 START

    • @Agustin-jo8mv
      @Agustin-jo8mv Před 3 lety

      hahahahaha. I was like for fuck sakes, when is the video starting. lolololollolololololol. It's a free lesson though no complaints. Just funny though. haha

  • @antipusrises
    @antipusrises Před 3 lety +1

    I love how you leave in the "why is this happening???" moments. It shows good problem solving strategies.

  • @aroshm1682
    @aroshm1682 Před 2 lety

    Ed!! my man!! this is awesome. thank you so so much. I can't event say how thankful I am. I learned a lot just from this video.

  • @GaLaVrAmOv
    @GaLaVrAmOv Před 4 lety +33

    Hey, awesome video,
    But I also wanna talk about a little problem that I saw.
    At 1:10:33 you're deleting a "todo" element by looking for it by the element text, and if you'd have the same element twice then it's gonna remove the very first element.
    My solution for that is to delete a text from the todos array by the index of the element, which is supposed to be with the same index in the todos array, just like that:
    const todoIndex = Array.from(todosList.childNodes).indexOf(todo);
    todos.splice(todoIndex, 1);
    And now, even if you had the same text in the todos list, it would delete the specific todo element that you have clicked on.

    • @markokafor7432
      @markokafor7432 Před 4 lety +2

      or simply add an id to each todo an then use the filter() to remove it would have been easier

    • @spectruum
      @spectruum Před 4 lety +1

      Or realistically why would you add the same task twice

    • @GaLaVrAmOv
      @GaLaVrAmOv Před 3 lety

      I don't know, maybe you'd want to go to the gym twice a day

    • @stevieholland3579
      @stevieholland3579 Před rokem

      @@markokafor7432 This makes sense to me. Curious, would I also use this to somehow get it to save the line through when I refresh, or is that harder to do? Sorry if this sounds dumb. I don't have much experience

    • @markokafor7432
      @markokafor7432 Před rokem

      @@stevieholland3579 the only way to save it so it doesn’t disappear when you refresh is to either save it to local storage or implement a database. If you are not saving it anywhere then it’ll disappear when you refresh

  • @vijethrevankar7937
    @vijethrevankar7937 Před 4 lety +18

    When filterind, i get this error. Can help me out?
    TypeError: todo.classList is undefined
    TypeError: todo.style is undefined

    • @hemantjain8777
      @hemantjain8777 Před 4 lety +21

      check if you have left blank space between the ul tag () . Get rid of the space and your problem will be solved, hopefully

    • @vijethrevankar7937
      @vijethrevankar7937 Před 4 lety

      @@hemantjain8777 yeah that was the issue

    • @kinglebron5437
      @kinglebron5437 Před 4 lety

      @@hemantjain8777 wow it fixed it, may i ask why is this the reason of the error?

    • @hemantjain8777
      @hemantjain8777 Před 4 lety +7

      @@kinglebron5437 when we get the list of the nodes, the empty text is returned without any class. This gives rise to the error.

    • @m.rohith1821
      @m.rohith1821 Před 4 lety

      If you don't mind can you please share the code . I am not able to get the part at 23:42 . I am not able to find the mistake.

  • @nigelpallatt
    @nigelpallatt Před 2 lety

    Love this follow along with thing, everything I have known for years but it feels fresh somehow ...

  • @edwandersonluizpereira764

    Sensational, I learned a lot from this video thank you and congratulations for the didactic and project presented!
    it was very productive for me, thanks Ed

  • @minstreet_studio6265
    @minstreet_studio6265 Před 3 lety +4

    2:08 IS THE REASON WHY THIS VIDEO IS 1 HOUR LONG😂😂😂😂😂

  • @TipsyRiver
    @TipsyRiver Před 3 lety +4

    Had some trouble with an error that said "Uncaught TypeError: Cannot read property 'addEventListener' of null" and none of the google/comment fixes did it for me.
    So, for anyone out therre with the same issue here's my fix:
    1. Go to index.html and add ithe "id" property to your main divs/buttons/lists. Set them equal to their class.
    2. Then go to the top of your app.js file. Use getElementById instead of querySelector when creating the todoInput/todoButton/etc variables.
    3. It should be working now.
    Dunno if it's an issue with JJ, chrome or something else, but querying for IDs is the only solution that worked for me after hours of trying things and searching SO.

    • @captainpeen9880
      @captainpeen9880 Před 3 lety +2

      i dont understand why is this happening

    • @srivatsajoshi
      @srivatsajoshi Před 3 lety +1

      It happened to me as well. That s because i forgot to add "dot" in querySelector('.todo-input'); . May be the same thing happened to you.

    • @severussin
      @severussin Před 3 lety

      @@srivatsajoshi I have not forgotten the dot but by app.js file doesn't work even though I've ensured its identical to whats in the video, any pointers?

    • @andreguimaraes9347
      @andreguimaraes9347 Před 2 lety

      You just saved me a lot of headache. Thank you so much!

  • @DANNFIGDESIGNS
    @DANNFIGDESIGNS Před rokem

    Thanks for the intro! 🤣 Love your videos!

  • @ericbeard7007
    @ericbeard7007 Před 4 lety

    Your quickly becoming my top 3 watched coding channels!

  • @tim.bogdanov
    @tim.bogdanov Před 4 lety +4

    at 52:30 im getting this error:
    Uncaught TypeError: Cannot set property 'display' of undefined
    at app.js:69
    at NodeList.forEach ()
    at HTMLSelectElement.filterTodo (app.js:66)
    (anonymous) @ app.js:69
    filterTodo @ app.js:66

    • @eric-hsueh
      @eric-hsueh Před 4 lety

      Tim Bogdanov me too😭

    • @vganesh5528
      @vganesh5528 Před 4 lety

      @vedran brendy your gineus .. how it is possible

    • @nicholasng1443
      @nicholasng1443 Před 4 lety +3

      This works for me:
      The problem is occurred at this line in index.html.
      Make sure between opening and closing tag of is EMPTY as in no space, no enter, just leave it blank.
      or can copy this and replace the code:
      Hope this helps.

    • @byronjones5713
      @byronjones5713 Před 4 lety +2

      I ended up testing the type of element in the list to look for Element node types before performing any operations. When a text node (or any node other than Element node) is encountered, it skips processing.
      function filterTodo(e) {
      const todos = todoList.childNodes;
      todos.forEach(function (todo) {
      //ignore text and other non-element nodes
      if (todo.nodeType === Node.ELEMENT_NODE) {
      // console.log(e.target.value);
      switch (e.target.value) {
      case "all":
      todo.style.display = "flex";
      break;
      case "completed":
      if (todo.classList.contains('completed')) {
      todo.style.display = "flex";
      } else {
      todo.style.display = "none";
      }
      break;
      case "uncompleted":
      if (!todo.classList.contains('completed')) {
      todo.style.display = "flex";
      } else {
      todo.style.display = "none";
      }
      break;
      }
      }
      })
      }

    • @MichaelWeston82
      @MichaelWeston82 Před 4 lety

      @@byronjones5713 this helped me a ton! Thanks for posting. I couldn't understand why the switch statement wasn't filtering. It was so frustrating. Then i added the if statement u provided plus the extra part for "uncompleted" case and Boom! Magic happens! Thanks again!

  • @fahadrahman585
    @fahadrahman585 Před 4 lety +3

    hi! I am having an "uncaught error: cannot set property 'display' of undefined."
    I would pretty much like to have some help here.

    • @SmeSSS
      @SmeSSS Před 4 lety +1

      I have the same problem. I think the error occurs, because if you check what console.log(todos) does after the "const todos = todoList.childnodes;" line, then you'll see, that we have an unneccesary element in the NodeList.
      Even though you add 0, 1, 2 or 3.... items, there will be always 1 more in the NodeList, because the first one will be a 'text' element, like this:
      NodeList(3) [text, div.todo, div.todo]
      I'm not sure why does it gets added. It has a wholeText: "↵↵ ". I'd also appreciate some insight if someone has. :)

    • @imane5971
      @imane5971 Před 4 lety

      im having the same issue,the classList seems to be undefined even though its right there..

    • @naimuddinmohammad7773
      @naimuddinmohammad7773 Před 4 lety

      I'm facing the same issue...does anyone has any solution for this

    • @fahadrahman585
      @fahadrahman585 Před 4 lety

      ​@@SmeSSS I am thinking is there any way to grab the class name of 'todo' and then set the 'className.style.display'. But anyway, um pretty much interested how Dev Ed ran it without having issues like us.
      there must be something that we missed.

    • @fahadrahman585
      @fahadrahman585 Před 4 lety +4

      everyone, I just solved the problem. remove all the spaces inside the ul tag.
      child nodes count those space as a text and assign an index for it.
      So, if you remove everything inside the ul tag your code will run perfectly.

  • @JnoobGodMode
    @JnoobGodMode Před 2 lety

    legit, love it dude, your the best

  • @pinderant
    @pinderant Před 4 lety

    Thank you very much for this project. Definitely learned a lot of concepts. Thinkin will modify this to some sort of inventory reorder checklist or something like that

  • @pradeepkumarreddykondreddy7048

    Anybody interested in implementing how to persist completed and uncompleted list to local storage, then you can check my repository github.com/kpradeepkumarreddy/todo-list
    At the end of the video Dev Ed said it is difficult to implement. But it is not so difficult.
    Instead of storing the item text alone to local storage, i'm storing the following object, where status is completed/uncompleted.
    class TODOItem {
    constructor(text, status) {
    this.text = text;
    this.status = status;
    }
    }

    • @adao5308
      @adao5308 Před 2 lety

      Checking this out. Thanks!

    • @harshwebdeveloper
      @harshwebdeveloper Před 2 lety +1

      thanks sir this was helful i was facing some problems

  • @wayupthep0unds
    @wayupthep0unds Před 2 lety +4

    For anyone getting the 'TypeError: Cannot read properties of undefined' error when trying to get the 'completed' filter to work, change:
    function filterTodo(e) {
    const todos = todoList.childNodes;
    todos.forEach(function (todo) {
    with:
    function filterTodo(e) {
    const todos = [...todoList.children];
    todos.forEach(function (todo) {
    childNodes returns a collection of - as it sounds like - child 'nodes'. Some of these nodes may not be elements, but text nodes - and text nodes have no classList property. Use .children instead, which will retrieve only child 'elements'.

    • @trudeauokech2234
      @trudeauokech2234 Před 2 lety +1

      Thank you so much for this! It is really helpful

    • @Tc-hs8rp
      @Tc-hs8rp Před 2 lety +1

      What do the "..." do?

    • @adept9162
      @adept9162 Před 2 lety

      This hasnt worked for me.

    • @richochet
      @richochet Před 9 měsíci +1

      Thanks, but this didn't work for me, same error message "Uncaught TypeError: todo.children is undefined"

  • @popescugeorgebogdan2506

    Thanks man. Great work. Love your style.

  • @hernang.naguibin6904
    @hernang.naguibin6904 Před 3 lety

    Finally got interest in JS, Thanks a lot Ed.