Learn DOM Manipulation In 18 Minutes

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • 🚨 IMPORTANT:
    JavaScript Simplified Course: javascriptsimplified.com
    DOM manipulation is tough. There are lots of methods and techniques you need to master and it is not obvious which methods are best for each scenario. In this video I cover the 14 most important DOM manipulation methods that you need to know.
    📚 Materials/References:
    DOM Traversal Methods Video: • Learn JavaScript DOM T...
    innerHTML Cross Site Scripting Video: • How To Prevent The Mos...
    Data Attributes Blog Article: blog.webdevsimplified.com/202...
    classList Blog Article: blog.webdevsimplified.com/202...
    🧠 Concepts Covered:
    - Creating elements
    - Adding elements
    - Modifying data attributes
    - Removing elements
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ Timestamps:
    00:00 - Introduction
    01:01 - Adding Elements
    02:58 - Creating Elements
    04:04 - Modifying Element Text
    07:30 - Modifying Element HTML
    10:22 - Removing Elements
    11:54 - Modifying Element Attributes
    14:11 - Modifying Data Attributes
    16:13 - Modifying Element Classes
    17:40 - Modifying Element Style
    #DOMManipulation #WDS #JavaScript

Комментарии • 540

  • @pixelfixer_
    @pixelfixer_ 3 года назад +1186

    I know it's not a big thing or anything, but thank you for timestamping your videos. It's so incredibly useful, and not enough content creators take the time to do that

    • @WebDevSimplified
      @WebDevSimplified  3 года назад +257

      I'm glad you appreciate it. I have been trying to do it on all my new videos.

    • @oscarleon3008
      @oscarleon3008 3 года назад +18

      @@WebDevSimplified Thank you for doing it, I always love it when someone in the comments does it for the longer videos. But it's even really cool that you take the time to do that yourself. Thanks for all the videos! I'm learning a ton from your channel.

    • @009a2
      @009a2 3 года назад +15

      Totally agree. I would add to that, that the times times may not be useful the first time you watch the video, but they are super useful on the second watch when you try to reference something :-)

    • @randominternetidot9263
      @randominternetidot9263 3 года назад +4

      Yeah some times I’m watching some programming video and I’m looking for some part of the video, but then I realize they didn’t take the time to put time stamps and I have to spend i while just looking for that part.

    • @randy918
      @randy918 2 года назад +1

      Thanks for all the timestamping. I rely on it, never ignore it.

  • @caneroncel
    @caneroncel 2 года назад +116

    As a 37 years old front-end developer I want to say that you are making a great job. You are very calm, your tone is cool and looks like you are know what are you doing :)
    World is a better place because of people like you. Keep going and share your knowledge bro.

    • @aymenob2484
      @aymenob2484 2 года назад +2

      Indeed i like the quality of his videos very helpful

  • @TruthSeekerClub
    @TruthSeekerClub 3 года назад +107

    You know why I choose you always to review topics or see your tutorial before I learn new technology?
    1. Very simple.
    2. Clear.
    3. Very direct.
    4. Detailed.
    6. Cover a lot.
    7. You cover important things.
    8. Organized.
    9. I can have excellent understanding what is this technology all about. In general.

  • @freshpootube
    @freshpootube 3 года назад +308

    I love how organised this guy is. Prepares chapters in his videos, provides links. So valuable.

    • @nischalbista6436
      @nischalbista6436 2 года назад

      @homo sexual feminine male whistleblower confesion how do you know ?

    • @carguy-xv2cl
      @carguy-xv2cl 2 года назад +4

      Even prepares his hair with gel.

    • @chadgregory9037
      @chadgregory9037 2 года назад

      It's like if Zach Morrison was actually a responsible smart person

    • @Winter_Wyvern1
      @Winter_Wyvern1 2 года назад

      @homo sexual feminine mal6 whistleblower confession what are u on

    • @thequantum-plator
      @thequantum-plator Год назад

      @homosexual feminine biological male sexual slut 3 s t f u bot

  • @RedBeardRetroTech
    @RedBeardRetroTech 3 года назад +31

    I've been watching these videos to study, they're very straightforward and make so much more sense compared to my professors. I appreciate you making these videos

  • @seanflood3987
    @seanflood3987 2 года назад +5

    Props for being so well spoken and organized. You do a really good job at taking a concept and explaining it in a user friendly way. A lot of courses these days don't explain the "why" enough when teaching. Good job dude great content!

  • @Nobody10150
    @Nobody10150 3 года назад +8

    your calm voice while explaining is making the info float easily in my brain.. a lot of thanks!

  • @patricklemmer9902
    @patricklemmer9902 2 года назад +1

    Just worked through this and another video about DOM traversal. I am extremely confident working with the DOM now, which wasn't the case 48hrs ago. Thank you so much for your clear instructions and on point explanations! Incredible value!

  • @Misfittykitty
    @Misfittykitty 2 года назад +5

    Thank you for your time and effort making this video. I have been banging my head against a wall for HOURS trying to understand this, and you have made it crystal clear. I will pay it forward one day--and wish you all the best. Thanks again for your kindness in teaching this (and so well!!) :) :)

  • @zakariakachani9143
    @zakariakachani9143 3 года назад +16

    Love this man he explain so well and act like a robot. LOVE IT !!

  • @user-ke4yx6uw1r
    @user-ke4yx6uw1r 3 года назад +2

    I just started learning DOM manipulation and here you are with the right video at the right time,
    Thank you much Kyle

  • @hamzahahmad1670
    @hamzahahmad1670 3 года назад +4

    Really great work . There aren't many proper DOM manipulation crash courses on youtube, so your efforts are very much appreciated. I know this is a very common thing to say on videos like these, but I actually opened youtube right now to search for a DOM manipulation crash course, so seeing this was a welcome surprise.

  • @cleansermacaroni9892
    @cleansermacaroni9892 2 года назад +1

    I have done a couple of frontend courses, and I didn't have any trouble with the content, but this is the first video that has made perfect sense of it all. Wow. Really nice. Thanks!

  • @chikkiidehalvi5561
    @chikkiidehalvi5561 3 года назад +2

    your videos are very to-the-point and worth the time, exactly what a programmer needs.

  • @mohamedyashar9940
    @mohamedyashar9940 2 года назад

    As a beginner I found it very crystal clear to build my foundation in DOM MANIPULATION. I'm glad that I found this video @ryt time. You have did a fantastic job!! Thank you.

  • @tiltify2393
    @tiltify2393 2 года назад +1

    You are absolutely awesome for actually organizing your content in an actually efficient way, that's not all over the place, like every other JS tutor on the internet out there

  • @terenceroberts5240
    @terenceroberts5240 3 года назад +15

    Yes, going to start donating to this guy. He is an asset.

  • @Snoo29293
    @Snoo29293 3 года назад +1

    I now got to learn about classList and dataset, I was afraid about the blog, because I had got so used to videos, but I gave a look to your article and it seemed pretty well made and short.

  • @jaylayoung2576
    @jaylayoung2576 6 месяцев назад

    Man, you're a lifesaver. I appreciate the work you put in on making these videos so straightforward, yet thorough.

  • @user-kn4oi9oh4i
    @user-kn4oi9oh4i 3 месяца назад +2

    OMG this guy helped me alot especially with difficult topics of CSS and Javascript! He explains everything so well! He's basically my mentor without him knowing it.

  • @imbrad99
    @imbrad99 2 года назад +1

    This video is incredibly helpful, thank you for all that you give to the community. You're brilliant and have taught me so much!

  • @leightonbuchanan-cates3932
    @leightonbuchanan-cates3932 Год назад +1

    This was insanely helpful, especially your explanation about the difference between innerText and textContent. Thank you so much and keep up the amazing work!

  • @cineverseproductions
    @cineverseproductions 2 года назад

    Bro.. you have a very strong and deep understanding of these basic web development things. Everything is counted and thank you so much for helping us with such things through your videos. One of the best RUclipsrs. 👍

  • @maxlong1374
    @maxlong1374 3 года назад

    Hello Kyle. This is the first video I watched in your channel. After watching this video, I have decided to watch ALL of your videos in your channel ASAP. I love the way you teach things. I love your mission. I'm going to like every video I've watched in your channel from now on. Thank you Amazing human.

  • @younessbouhjar9576
    @younessbouhjar9576 3 года назад +13

    A quick tip:
    in case you want to delete multiple elements in a div for example.
    document.getElementsByClassName('class-name') delivers a nodeList.that means you'll get an error if you used the remove() method.
    instead change style.display for all nodes by looping through the list for example:
    var div= document.getElementsByClassName('class-name');
    for (var i=0;i

    • @xXYourShadowDaniXx
      @xXYourShadowDaniXx 2 года назад +3

      Or you can do it the correct way for deleting and loop through the NodeList and run remove() per element?
      let div=document.getElementsByClassName("test");
      Array.from(div).forEach((elem)=>{
      elem.remove();
      });

  • @DigitallyAlex
    @DigitallyAlex 6 месяцев назад

    You are a literal life saver Kyle, managed to help me understand how this works in such little time. Thank you!

  • @yashmodi2432
    @yashmodi2432 Год назад +2

    Thank you so much..Your content is very much precise and to the point and better than 2 hrs of video that other creators are making to explain this simple thing

  • @hg-yg4xh
    @hg-yg4xh Год назад

    He has a gift for teaching, he answered all my unanswered questions all throughout the video that I didn't know how to articulate.

  • @jimhalpert9803
    @jimhalpert9803 3 года назад +1

    Glad you talked about the security flaws of element.innerHTML. More people need to know how dangerous it can be if you let user put custom raw html into the page.

  • @mayankarote4750
    @mayankarote4750 3 года назад +2

    Thank you for teaching this tough thing in a very simple way

  • @alyciariley3303
    @alyciariley3303 2 года назад

    This is great! All of my experience has been with jQuery and I am currently refactoring my Bootcamp projects to VanillaJS for practice. You explained everything so clearly. Thank you!

  • @techbizcanada7594
    @techbizcanada7594 3 года назад

    Thank you. You're a good teacher. Your presentation style is clear and concise. I like that very much.

  • @TheCodingOdyssey
    @TheCodingOdyssey 3 года назад +179

    You can hear semi-colon singing ' Wish I was here' in the background' :D

    • @nabilhaouam8497
      @nabilhaouam8497 3 года назад +7

      😅😅😂, he’s a legend though

    • @TheCodingOdyssey
      @TheCodingOdyssey 3 года назад +5

      @@nabilhaouam8497 ha ha thats why there are songs singing in the background

    • @johnyepthomi892
      @johnyepthomi892 3 года назад +2

      i get ocd. I make sure to use it since working with different launguages it makes it easier.

    • @fazlerabbi3093
      @fazlerabbi3093 3 года назад +2

      And the JS shouting "I am too smart to live without you".

    • @hikari1690
      @hikari1690 3 года назад

      I hear ;_; saying “I’m not needed anymore”

  • @logusgraphics
    @logusgraphics 3 года назад +1

    Your channel is amazing. The content is not only educational but very entertaining.

  • @InsipidTawfiiq
    @InsipidTawfiiq 19 дней назад

    Your tone is very calm and soothing

  • @adsrinivasan
    @adsrinivasan 2 года назад

    By far your teaching is good compared to other tutors. Thanks a ton

  • @goisborges
    @goisborges 3 года назад

    As soon as I get some availability I'll purchase your course. Don't stop sharing content, bro. Your explanations are great.

  • @vergilkelley2378
    @vergilkelley2378 3 года назад

    you deserve 2 thumbs up. love your content, you make it easy to understand!

  • @fabiomazzei9871
    @fabiomazzei9871 2 года назад +3

    Excellent class! Thanks for sharing your knowledge. I learned a lot, sincerely.
    A thousand 'likes' for you!!!

  • @obasaajibola3933
    @obasaajibola3933 Год назад

    Thank you for your teaching. It has truly helped me in solving a lot of problems I thought I could not solve.

  • @tolgaacar1296
    @tolgaacar1296 3 года назад +16

    I recommend you to import your js files after the tags in html files. Because The script can begin executing before the DOM is fully loaded. Then null property errors will occur.

  • @SK-vg3mw
    @SK-vg3mw Год назад

    Thank you, your channel is a goldmine for beginners!

  • @azaramirli2601
    @azaramirli2601 10 месяцев назад

    thank you for the time you are putting in. I hope you are getting something back out of it. You are dropping golden information generously. Can you please make a video in the future about most of your favorite shortcuts you use while coding.🙏

  • @yasirtahirkheli74
    @yasirtahirkheli74 2 года назад

    Am scratching and pulling my hair at the moment for being idiot to have been missing this truly helpful and life-saving channel. This is exactly what i have been struggling for as I plan to replace all the jquery code from my projects with plain javascript. You are a gem mate! watched and subscribed.

  • @joeleone6276
    @joeleone6276 2 года назад +1

    This material is presented very easily and understandable for many different skill levels.

  • @Supernova12034
    @Supernova12034 Год назад

    Great video! really helped nail down the DOM concepts for me.

  • @BuzzMarketingKe
    @BuzzMarketingKe Год назад

    Thanks a lot for making the world an easier place.
    much appreciation from Kenya.

  • @philipf2454
    @philipf2454 Год назад

    Good introduction to the DOM. Thank you!

  • @michaelrooze278
    @michaelrooze278 3 года назад +13

    It would be cool to see examples of how you have used these in your own code....How often are you working with vanilla JS vs a framework?

  • @codeAlongwith
    @codeAlongwith Год назад

    I have really enjoyed this. Thanks so much.

  • @jesuschuyandres
    @jesuschuyandres 3 года назад

    Awesome stuff Kyle. Thank you so much!

  • @sanjitselvan5348
    @sanjitselvan5348 Год назад

    Here's someone who's teaching people stuff that REALLY matters in the frontend world. Thanks a ton Kyle!

  • @flux2956
    @flux2956 2 года назад

    Your slider carousel tutorial is much clearer now because of this video. I just had to subscribe.

  • @bama2619
    @bama2619 4 месяца назад

    brief and fast, thank you.

  • @bruhmoment3731
    @bruhmoment3731 2 года назад

    Thank you! You're such a great teacher!

  • @johny962
    @johny962 11 месяцев назад

    The toggle method is so cool!

  • @tenzinwoeser6842
    @tenzinwoeser6842 3 года назад

    Thank you for brushing me up with Js DOM manipulation

  • @helloredwan
    @helloredwan 3 года назад

    Thank You Brother ❤❤. It's so helpful and learned something new

  • @Peywan
    @Peywan Год назад

    thaknks, was a good pace to follow along while you were explaining!

  • @kwalsh7107
    @kwalsh7107 Год назад

    I really appreciate your videos. Explained really well. Thank you!

  • @madinaabbasi3837
    @madinaabbasi3837 Год назад +3

    This was the best explanation thank you a lot. Also the Wow part for me was in 17:54 when it goes to style css elements by JavaScript 😻🍬👋🏻

  • @remoralite6027
    @remoralite6027 Год назад

    Awesome content as always, Kyle! Love the Rise Against shirt :)

  • @brianginn1993
    @brianginn1993 2 года назад

    Excellent content which I’ve come to expect from you Kyle.

  • @ThePaddingtonsChannel
    @ThePaddingtonsChannel 9 месяцев назад +1

    That "dataset" Property seems really convenient. Learned something new 👍

  • @FunnyInternetTrends
    @FunnyInternetTrends Год назад +1

    Wow amazing tutorial. Thank you.
    Last part i get goosebumps.
    CSS in JS is CSS in CamelCase. Wow this changed my life

  • @manishwalia1102
    @manishwalia1102 3 года назад +1

    Finally I understood this concept thank u so much sir

  • @rayankhan12
    @rayankhan12 2 года назад

    This is by far the best video on JS DOM manipulation I've ever watched! I would've given it a million likes if I could! :p Thank you soooo much Kyle :)

  • @Odidi_Bee6ix
    @Odidi_Bee6ix Год назад

    One of the Best js.DOM tutorials on RUclips

  • @thepopstudio2354
    @thepopstudio2354 2 года назад

    You are phreaking awesome! thanks

  • @awszr
    @awszr 3 года назад

    Very nice!!You covered many chapters of the book i’ve been reading which is (a smarter way to learn JavaScript) in a single video.

  • @tasya_nabila
    @tasya_nabila 3 года назад

    It really REALLY help meeeee. I was learning DOM at college but understand nothing at all!! Thank youuu 😢😢😢

  • @nevouxjulie6595
    @nevouxjulie6595 3 месяца назад

    Thank you so much for this video !!

  • @clami1374
    @clami1374 Год назад

    Very clear and nice video. Great job!

  • @spondoolie6450
    @spondoolie6450 2 года назад +1

    I've been on my JavaScript journey for about 1.5 months. Once I learned about the DOM everything now seems to make sense, where as before it was literally a guessing game on which methods to use to make things happen. This video is perfect for someone like me that needs a quick-start (sorry, I mean "quickStart") reference where I can have a short video that neatly explains all the methods I'm going to use > 90% of the time.
    Kyle is the man.

    • @xXYourShadowDaniXx
      @xXYourShadowDaniXx 2 года назад +1

      Yes this video is one of the few that I would suggest to new JS devs, so they can learn actual Vanilla JS properly. Then once you can confidently make sites and tools with Vanilla JS you should try graduating to Vue / React / Angular.

  • @dansf2
    @dansf2 2 года назад

    Well done. You present the material nicely.

  • @thewetfly9207
    @thewetfly9207 Год назад +2

    I really like your content, thank you 🙂

  •  3 года назад +1

    Hi, Kyle! I really owe you big because I really like to know what I am doing and you surely explain not only how to do things but also why you do whatever you do; but I need to tell you that I hate when you, sometimes, get too rethorical in trying obsesively to make things clear.
    I give you and hipothetical example:
    We do this but you can see it because this has no content. Now we write this' content and you can see it because now this has a content that is why you couldn't see it before because it had no content but now you see it because now it has a content.
    I make this observation not to make you change your ways but hoping it might help as any feedback does.

  • @514fadeaway8
    @514fadeaway8 3 года назад

    THANK YOU KYLE {hope that's the way you spell it}
    completed my assignment with this one video but their soo much to learn

  • @Soap_js
    @Soap_js 3 года назад +151

    00:00​ - Introduction
    01:01​ - Adding Elements
    02:58​ - Creating Elements
    04:04​ - Modifying Element Text
    07:30​ - Modifying Element HTML
    10:22​ - Removing Elements
    11:54​ - Modifying Element Attributes
    14:11​ - Modifying Data Attributes
    16:13​ - Modifying Element Classes
    17:40​ - Modifying Element Style

  • @effymichael95
    @effymichael95 Год назад

    Very very useful video! Thank you

  • @michaelanthony4750
    @michaelanthony4750 2 года назад

    Concise and thorough

  • @samip4sure
    @samip4sure 3 года назад +3

    I've been doing too much React and NodeJS, I was looking for DOM refresher. Great Stuff !

    • @TheCodingOdyssey
      @TheCodingOdyssey 3 года назад +1

      This is true, when I got into coding I started working directly in React and didn't do that much dom manipulation, only in some small personal projects

    • @TesterAnimal1
      @TesterAnimal1 3 года назад

      HTML authors will always need software engineers.

  • @devluxx
    @devluxx Год назад

    Thanks man, love this.

  • @anvarsaidov8964
    @anvarsaidov8964 2 года назад

    Thank you, very clear explanation.

  • @gasycube4075
    @gasycube4075 3 года назад +3

    Yeah, I just started learning JS recently! This kind of video just make want to learn mooore! Thanks mate!

    • @TheCodingOdyssey
      @TheCodingOdyssey 3 года назад

      Good luck with your journey. Its a rewarding one.

  • @nwokporochukwuebuka
    @nwokporochukwuebuka Год назад

    Thank you sir.
    Your videos have helped me become a better developer

  • @heritiersefu4539
    @heritiersefu4539 Год назад

    Bro this is the best DOM video. thanks

  • @grigcnc3504
    @grigcnc3504 3 года назад

    Thanx, nice video. DOM-manipulation became simplier

  • @gautamkanzariya8651
    @gautamkanzariya8651 3 года назад +1

    very good points covered.thanks you sir...

  • @NewDayMedia.
    @NewDayMedia. Год назад

    Kyle bro please consider teaching full time . last few months i watched thousands of tutorials i swear you have a better way of making me understand things than anyone else.

  • @vinaydavda4813
    @vinaydavda4813 2 года назад

    very good quick tutorial. Thanks.

  • @Tweetycraft
    @Tweetycraft Год назад

    Absolutely awesome..👍👍

  • @carolinaloaiza2924
    @carolinaloaiza2924 2 года назад

    I love your videos, you have a very special way to make you understand, thank u for existing 💙🍀🤘

  • @francisdayl
    @francisdayl 2 года назад

    I'm very thankful, this video is beyond helpfull!!!.

  • @ManojSatishkumar
    @ManojSatishkumar 3 года назад +2

    I'm in the same path as you brother. I teach web development too and have nearly a decade of professional experience

  • @purplealma
    @purplealma 3 года назад

    Thanks for explaining, merry Christmas

  • @music6591
    @music6591 2 года назад

    Nice video ! Very important part about innerText vs textContent

  • @dawarlatif3832
    @dawarlatif3832 Год назад

    your way of teaching is elite, there's a request to make a tutorial series on NesstJs framework

  • @arcosd63
    @arcosd63 2 года назад

    This was awesome!

  • @phamelamhlaba4024
    @phamelamhlaba4024 11 дней назад

    I kinda have an idea of of DOM Manipulation. Thank you🙏🏾