document.getElementByClass("className")//This method only returns the child element of the specified Class.
Fixed:
document.getElementsByClassName("className")//This method returns all elements inside the whole document by the class you specified.document.getElementById("someElement").getElementsByClassName("className")//It works in all elements of the DOM, this will return all elements by the class you specify inside the element you want
Just sharing my learning experiences in tech. Follow for Front-end related content in REACT
Fun fact: I love coffee, especially caramel lattes, and cappuccinos
Location
Baltimore, MD
Education
Flatiron School | New York City College of Technology
Does anyone know of a book that focuses solely on the DOM and methods associated with the Document object? MDN is a great resource but I don’t find the guides on the DOM that helpful.
Good article. Also if we have frequent Dom manipulation, good way to manipulate the Dom is by using createDocumentFragment(API) for better performance.
Just sharing my learning experiences in tech. Follow for Front-end related content in REACT
Fun fact: I love coffee, especially caramel lattes, and cappuccinos
Location
Baltimore, MD
Education
Flatiron School | New York City College of Technology
I've seen videos covering this topic, I can't keep up with them but this one is just simple and direct to the point. Now I can go and re-watch those videos with a better fundamental of this subject.
Am a Blessed man.I Write solidity for smart contracts on EVM compatible Blockchains. Am very interested in Defi products and would love to work with you.
Just a little fix in:
Fixed:
Good job 😄
Thanks, just updated it.
good one
This one is quite special method, and is harder explain than
Well,
document.bodyis a special DOM object traversal.Does anyone know of a book that focuses solely on the DOM and methods associated with the Document object? MDN is a great resource but I don’t find the guides on the DOM that helpful.
Search for Dom tutorial by Brad Traversy on youtube, he pretty much covered all you need and I hope this is not coming too late.
Thanks man. I will take a look! 😎
By the way, his name feels very appropriate: traversing the DOM with Brad Traversy.
Haha!.... You welcome
Good article. Also if we have frequent Dom manipulation, good way to manipulate the Dom is by using createDocumentFragment(API) for better performance.
Great Article Iqra!. Keep writing.
Thanks!
I've seen videos covering this topic, I can't keep up with them but this one is just simple and direct to the point. Now I can go and re-watch those videos with a better fundamental of this subject.
Thank you. 🤘
Clear and brief 👍🏼
Thanks for this simple article!
thanks for the reminder